react-transition-group icon indicating copy to clipboard operation
react-transition-group copied to clipboard

Avoid the deprecated usage of `defaultProps`

Open LukasTy opened this issue 6 months ago • 2 comments

What would you like improved?

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

Resources:

  • https://twitter.com/dan_abramov/status/1133878326358171650
  • https://github.com/jsx-eslint/eslint-plugin-react/issues/2396
  • https://github.com/mui/mui-x/issues/11531

LukasTy avatar Dec 29 '23 15:12 LukasTy

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

oliviertassinari avatar May 04 '24 17:05 oliviertassinari

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. 🤷

LukasTy avatar May 06 '24 08:05 LukasTy