davidtheclark / react-aria-modal

A fully accessible React modal built according WAI-ARIA Authoring Practices
http://davidtheclark.github.io/react-aria-modal/demo/
MIT License
1.03k stars 96 forks source link

"componentWillMount" is no longer recommended #93

Closed grgr-dkrk closed 3 years ago

grgr-dkrk commented 4 years ago

The componentWillMount method is deprecated since React 16.3, and it will be removed in React 17. (we will now see a warning when using it in 16.9)
It's necessary to use the constructor or componentDidMount method instead of componentWillMount.
We can also use the UNSAFE_componentWillMount but it's not needed in this case I think.

https://github.com/davidtheclark/react-aria-modal/blob/d19442e97e3e3565381723c85b197b8de0df364a/src/react-aria-modal.js#L18-L24

react-displace has the same problems, and needs fix to both.
Please check this PR: https://github.com/davidtheclark/react-displace/pull/8

toolness commented 4 years ago

Thanks, I think this is currently being worked on in https://github.com/davidtheclark/react-aria-modal/pull/95! Hopefully it will be merged soon.

scottm-cc commented 2 years ago

This issue is two years old now and has not actually been fixed yet by #95 (also about 2 years old) or #108 (almost a year old). The warning alone clutters up consoles and test suites. I am simply commenting to vouch for something to be done about this.

marlomgirardi commented 2 years ago

Fixed at #121