potion icon indicating copy to clipboard operation
potion copied to clipboard

componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details

Open tangrammer opened this issue 5 years ago • 2 comments

Hi @finnfiddle :)

We've updated react to last version on akvo-lumen client and now we get this problem that I'd bet that comes from your lib 🤔

  • Move code with side effects to componentDidMount, and set initial state in the constructor.
  • Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: _class

... Please update the following components: Text

I tried to run npx react-codemod rename-unsafe-lifecycles in your lib but the results are weird 😬

any ideas??

have a good day!

tangrammer avatar Apr 06 '20 12:04 tangrammer

Hi @tangrammer nice to hear from you. Thanks for reporting Ill take a look into it

finnfiddle avatar Apr 06 '20 19:04 finnfiddle

hey I looked into it but couldnt reproduce. Please could you provide a reproducible example/repo and I will sort it out. thanks

finnfiddle avatar Apr 09 '20 21:04 finnfiddle