-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove defaultProps usages for functional components #7224
base: react-18.3.0-upgrade
Are you sure you want to change the base?
Remove defaultProps usages for functional components #7224
Conversation
Signed-off-by: Max Shepel <max@undeletable.name>
…parameter value Signed-off-by: Max Shepel <max@undeletable.name>
* fix: Storybook - RangeInput/Bounds example * feedback: use usEeffect for disable buttons * feedback: use usEeffect for disable buttons * fix: lint fix
@undeletable |
@britt6612 Pagination tests fail sometimes because of different reason (slowness), but I got your point. I'll take a look. |
@jcfilben @britt6612 I've noticed that target branch in #7249 is different from master. Should I change target branch to |
@britt6612 I've added fallbacks to default theme to all the remaining places I saw that might be needed. Tests on both my and your branch passed. |
…b@users.noreply.github.com> On behalf of Basith <134603758+abdulbasithqb@users.noreply.github.com>, I, Max Shepel <max@undeletable.name>, hereby add my Signed-off-by to this commit: 2a4e9ac Signed-off-by: Max Shepel <max@undeletable.name>
…rchibeque@Brittanys-MBP-2.home> On behalf of Brittany Archibeque <brittanyarchibeque@Brittanys-MBP-2.home>, I, Max Shepel <max@undeletable.name>, hereby add my Signed-off-by to this commit: a954793 On behalf of Brittany Archibeque <brittanyarchibeque@Brittanys-MBP-2.home>, I, Max Shepel <max@undeletable.name>, hereby add my Signed-off-by to this commit: f492adb On behalf of Brittany Archibeque <brittanyarchibeque@Brittanys-MBP-2.home>, I, Max Shepel <max@undeletable.name>, hereby add my Signed-off-by to this commit: 3fd3a11 Signed-off-by: Max Shepel <max@undeletable.name>
…ben@users.noreply.github.com> On behalf of Jessica Filben <54560994+jcfilben@users.noreply.github.com>, I, Max Shepel <max@undeletable.name>, hereby add my Signed-off-by to this commit: 60d5ece Signed-off-by: Max Shepel <max@undeletable.name>
I, Max Shepel <max@undeletable.name>, hereby add my Signed-off-by to this commit: a1a5a03 I, Max Shepel <max@undeletable.name>, hereby add my Signed-off-by to this commit: a092b71 I, Max Shepel <max@undeletable.name>, hereby add my Signed-off-by to this commit: fa50a41 Signed-off-by: Max Shepel <max@undeletable.name>
@undeletable so yes what I did was make that new PR which will get merged into Thank you for adding this for the rest of the components |
@britt6612 I've changed base branch to |
@undeletable thank you! Hoping my PR gets merged early next week! then we can merge yours! |
Signed-off-by: Max Shepel <max@undeletable.name>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
What does this PR do?
Starting from React 19,
defaultProps
for functional components is deprecated. Starting from React 18.3, the corresponding error is thrown for a functional component withdefaultProps
defined.Changes in this PR:
defaultProps
for functional components with default function parameters values;attrs
method ofstyled-components
to pass theme to styled components which might be outside of theme context (required per remove defaultProps from Grommet #6741 (comment));defaultProps
for functional components;Where should the reviewer start?
No specific place to start.
What testing has been done on this PR?
How should this be manually tested?
Use React 18.3+ in an app. Check that styles are applied correctly and no errors about
defaultProps
are thrown into console.Do Jest tests follow these best practices?
screen
is used for querying.asFragment()
is used for snapshot testing.Any background context you want to provide?
React 19 upgrade guide
What are the relevant issues?
Closes #6741
Screenshots (if appropriate)
N/A.
Do the grommet docs need to be updated?
Just the internal ones (if any).
Should this PR be mentioned in the release notes?
Yes.
Is this change backwards compatible or is it a breaking change?
Changes are backwards compatible.