react-toggle icon indicating copy to clipboard operation
react-toggle copied to clipboard

React StrictMode error

Open cristian-gabbanini opened this issue 6 years ago • 2 comments

Hi, I am using your component in a few different apps and, by the way, I would like to thank you because it is very usefull and easy to use.

I recently enabled React.StrictMode in one of my apps and it showed me the following error:

Warning: Unsafe lifecycle methods were found within a strict-mode tree: in StrictMode

componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: Toggle

react-toggle: v4.0.2 react: v16.8.2 react-dom: v16.8.2

React.StrictMode is pretty useful in spotting potential problems and I thouth it was worth opening an issue. Many thanks 👍

cristian-gabbanini avatar Mar 07 '19 14:03 cristian-gabbanini

https://github.com/aaronshaf/react-toggle/pull/136

This PR fixes the issue. I'm not sure how you link an existing PR to an issue.

paulinfrancis avatar May 16 '19 13:05 paulinfrancis

Hi, I think you should be able to add in the body of your pull request one of these keywords: https://help.github.com/en/articles/closing-issues-using-keywords So that when it will be merged, this issue will be automatically closed

cristian-gabbanini avatar May 16 '19 14:05 cristian-gabbanini