Skip to content
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 default props from functional components #1906

Merged
merged 10 commits into from
May 20, 2024
Merged

Conversation

Huongg
Copy link
Contributor

@Huongg Huongg commented May 15, 2024

Description

Fixes #1905

Development notes

I've removed the defaults props from our Functional components, set them directly in the props values instead

QA notes

All the tests have passed and everything seems to work fine form my side

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Signed-off-by: huongg <huongg1409@gmail.com>
Signed-off-by: huongg <huongg1409@gmail.com>
Signed-off-by: huongg <huongg1409@gmail.com>
Signed-off-by: huongg <huongg1409@gmail.com>
@Huongg Huongg requested a review from astrojuanlu as a code owner May 15, 2024 11:07
@Huongg Huongg requested a review from tynandebold May 15, 2024 11:07
Copy link
Member

@tynandebold tynandebold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I left one comment.

I did a project-wide find for defaultProps and found one left:

App.defaultProps = {

But it's in the /tools/test-lib directory so I don't think it matters too much.

Signed-off-by: huongg <huongg1409@gmail.com>
@Huongg
Copy link
Contributor Author

Huongg commented May 15, 2024

Looks great! I left one comment.

I did a project-wide find for defaultProps and found one left:

App.defaultProps = {

But it's in the /tools/test-lib directory so I don't think it matters too much.

yeah I didn't remove it cause it seems like there was no error, but maybe best to remove it too, to be consistent with the rest

Huongg and others added 3 commits May 15, 2024 15:51
Signed-off-by: huongg <huongg1409@gmail.com>
…fault-props

Signed-off-by: huongg <huongg1409@gmail.com>
@Huongg Huongg merged commit e909630 into main May 20, 2024
13 checks passed
@Huongg Huongg deleted the warning-default-props branch May 20, 2024 08:24
This was referenced May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning in the console when Using DefaultProps on Function Components
3 participants