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 defaultProps copy #3184

Open
oliviertassinari opened this issue May 4, 2024 · 2 comments
Open

Remove defaultProps copy #3184

oliviertassinari opened this issue May 4, 2024 · 2 comments

Comments

@oliviertassinari
Copy link

oliviertassinari commented May 4, 2024

Current behavior:

Styled.defaultProps = tag.defaultProps

Expected behavior:

No copy.

Context

React 19 is removing this prop, https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-proptypes-and-defaultprops since it was deprecated 5 years ago: facebook/react#16210.

I think that at one point, we will want to remove this line to save bundle size and avoid confusion like in mui/mui-x#11531.

Environment information:

  • react version:
  • @emotion/react version:
@Andarist
Copy link
Member

Andarist commented May 4, 2024

We have to plan to do this in the next major version that will only be compatible with React 19 (at least that's my current line of thinking about this).

@oliviertassinari
Copy link
Author

oliviertassinari commented May 4, 2024

It's a detail, I would personally not rush it. I mostly wanted to have a place to document this likely future change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants