reactjs / react-transition-group

An easy way to perform animations when a React component enters or leaves the DOM
https://reactcommunity.org/react-transition-group/
Other
10.18k stars 649 forks source link

Avoid the deprecated usage of `defaultProps` #898

Open LukasTy opened 11 months ago

LukasTy commented 11 months ago

What would you like improved?

The defaultProps is deprecated and its usage should be replaced with default parameters.

Resources:

oliviertassinari commented 6 months ago

React 19 is removing support for .defaultProps: https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-proptypes-and-defaultprops on function components.

LukasTy commented 6 months ago

Clarification: the support is being removed for function components—the case of @emotion. As for this library, it's still using classes and the approach here seems valid. 🤷