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

Unsafe hook componentWillUpdate

Open NoriSte opened this issue 6 years ago • 8 comments

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

NoriSte avatar Apr 03 '19 08:04 NoriSte

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-lifecycles in your project source folder.

wpp avatar Aug 26 '19 14:08 wpp

Same issue we need a fix for the react 16.9.0.

can-kayacan avatar Sep 13 '19 13:09 can-kayacan

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... 🤕

PhEEP avatar Sep 23 '19 20:09 PhEEP

Any update on this?

karlsandin avatar Oct 08 '19 13:10 karlsandin

Guys did you drop further development? You didn't released since 14 Jun 2018

vaske avatar Oct 31 '19 22:10 vaske

is there a replacement for this lib?

alexandrzavalii avatar Nov 04 '19 14:11 alexandrzavalii

I made a complete rewrite using modern hooks: react-lottie-player. No more deprecation warnings!

mifi avatar Jul 12 '20 20:07 mifi

use the latest version of lottie ===>>>> lottie-web react-lottie or web-react-lottie are not updated

SaraSadeghnejad avatar Sep 27 '23 11:09 SaraSadeghnejad