react-lottie
react-lottie copied to clipboard
Unsafe hook componentWillUpdate
Hi guys I've just enabled React.strictMode for my app and the only warning I get is related to Lottie
index.js:1446 Warning: Unsafe lifecycle methods were found within a strict-mode tree:
in StrictMode
componentWillUpdate: Please update the following components to use componentDidUpdate instead: Lottie
Learn more about this warning here:
https://fb.me/react-strict-mode-warnings
That's the indicted code, is there a safe way to remove the hook without compromising how Lottie work?
Thank you for all 😊 Stefano
Since updating to React 16.9.0 I've also been getting this warning and the suggestions:
- Move data fetching code or side effects to componentDidUpdate.
- Rename componentWillUpdate to UNSAFE_componentWillUpdate 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-lifecyclesin your project source folder.
Same issue we need a fix for the react 16.9.0.
Could it be moved into componentDidUpdate and compare prevProps? Sorry for the lazy response, but this is also an issue for us as we update our codebase and I just got around to investigating this.
Edit: Ah, it says to do that in the suggestions... 🤕
Any update on this?
Guys did you drop further development? You didn't released since 14 Jun 2018
is there a replacement for this lib?
I made a complete rewrite using modern hooks: react-lottie-player. No more deprecation warnings!
use the latest version of lottie ===>>>> lottie-web react-lottie or web-react-lottie are not updated