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.1k stars 652 forks source link

Avoid the deprecated usage of `defaultProps` #898

Open LukasTy opened 6 months ago

LukasTy commented 6 months ago

What would you like improved?

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

Resources:

oliviertassinari commented 1 month 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 1 month 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. 🤷