react-animated-number icon indicating copy to clipboard operation
react-animated-number copied to clipboard

support for react 16.9/17.0

Open madmed88 opened this issue 5 years ago • 4 comments

when using with react 16.9 we have this warning:

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps 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: AnimatedNumber

madmed88 avatar Aug 19 '19 15:08 madmed88

Hey, @madmed88 @nanexcool @ameyms @phiresky @a-axton

As of React 16.9.x it seems the authors are beginning their transition to a full hooks or hooks preferred component strategy. This latest change requires that all componentWillMount, componentWillReceiveProps & componentWillUpdate calls, including those within bundle dependency packages, be prefixed with the UNSAFE_ prefix in order to dismiss the below console warnings. Of which, in my latest app where I'm using power-select I get about 4 per instance. I'd love to continue using react-animated-number for all my numerical needs, but have some stricter demands from my colleagues on console warnings, if you would kindly check into this, I'd be most appreciative. Thanks

Btw been a fan of your library for a years now and have used it in just about every react project I've worked on.

https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html

Screen Shot 2019-08-22 at 11 34 38 AM

nypinstripes avatar Aug 22 '19 15:08 nypinstripes

Hey, @madmed88 @nanexcool @ameyms @phiresky @a-axton

As of React 16.9.x it seems the authors are beginning their transition to a full hooks or hooks preferred component strategy. This latest change requires that all componentWillMount, componentWillReceiveProps & componentWillUpdate calls, including those within bundle dependency packages, be prefixed with the UNSAFE_ prefix in order to dismiss the below console warnings. Of which, in my latest app where I'm using power-select I get about 4 per instance. I'd love to continue using react-animated-number for all my numerical needs, but have some stricter demands from my colleagues on console warnings, if you would kindly check into this, I'd be most appreciative. Thanks

Btw been a fan of your library for a years now and have used it in just about every react project I've worked on.

https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html

Screen Shot 2019-08-22 at 11 34 38 AM

We used https://www.npmjs.com/package/patch-package to cover packages who are not updated yet.

michaelfreund avatar Aug 30 '19 13:08 michaelfreund

Hey @ameyms, is there interest in accepting a pull request to address this?

wwahammy avatar Dec 21 '19 06:12 wwahammy

I also get this warning when using this component:

componentWillReceiveProps has been renamed, and is not recommended for use.

tonix-tuft avatar May 26 '20 14:05 tonix-tuft