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

fix(react): remove defaultProps from sidebar, use default parameters instead #1764

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

scurker
Copy link
Member

@scurker scurker commented Dec 13, 2024

Fixing the following error:

console.error
Warning: SideBarItem: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
at SideBarItem (/home/runner/work/cauldron/cauldron/packages/react/src/components/SideBar/SideBarItem.tsx:12:8)
at ul
at nav
at ClickOutsideListener > (/home/runner/work/cauldron/cauldron/packages/react/src/components/ClickOutsideListener/index.tsx:17:5)
at SideBar (/home/runner/work/cauldron/cauldron/packages/react/src/components/SideBar/SideBar.tsx:33:5)

@scurker scurker requested a review from a team as a code owner December 13, 2024 20:57
@scurker scurker requested a review from a team December 13, 2024 20:57
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1764.d15792l1n26ww3.amplifyapp.com

Copy link
Member

@stephenmathieson stephenmathieson left a comment

Choose a reason for hiding this comment

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

We should always be doing this. IMO it's worth updating the contributing/style guide to say not to use React's defaultProps.

@scurker
Copy link
Member Author

scurker commented Dec 13, 2024

We should always be doing this. IMO it's worth updating the contributing/style guide to say not to use React's defaultProps.

Yup. I think it was a holdover from some old code and doesn't exist anywhere else.

@scurker scurker merged commit e4a3441 into develop Dec 13, 2024
8 checks passed
@scurker scurker deleted the sidebar-defaultprops branch December 13, 2024 21:51
stephenmathieson added a commit that referenced this pull request Dec 13, 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.

2 participants