Fix componentWillUpdate has been renamed warning#23
Open
sidhantpanda wants to merge 1 commit intofelippenardi:masterfrom
Open
Fix componentWillUpdate has been renamed warning#23sidhantpanda wants to merge 1 commit intofelippenardi:masterfrom
componentWillUpdate has been renamed warning#23sidhantpanda wants to merge 1 commit intofelippenardi:masterfrom
Conversation
Moves the extraction of props and eventListeners logic from `componentWillUpdate` to `componentDidUpdate`. This fixes the following warning from the console: ``` Warning: componentWillUpdate 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. * 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. Please update the following components: Lottie ```
|
@felippenardi - could we have this merged in please? 🙏🏻 |
chrisnojima
reviewed
Dec 16, 2019
| if (this.options.animationData !== nextProps.options.animationData) { | ||
| this.deRegisterEvents(this.props.eventListeners); | ||
| componentDidUpdate(prevProps) { | ||
| if (prevProps.options.animationData !== this.props.options.animationData) { |
There was a problem hiding this comment.
this is slightly incorrect. It should be this.options here and on line 45 instead of prevProps.options
Author
There was a problem hiding this comment.
How would you write the if condition here?
randytarampi
added a commit
to randytarampi/lottie-react-web
that referenced
this pull request
May 26, 2020
Pick up the changes in felippenardi#23
|
would be nice to have this warning removed 👍 |
|
Is it possible to get this merged? Would be awesome to get this error removed |
|
@felippenardi there is possible to get any news about the merge of this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the extraction of props and eventListeners logic from
componentWillUpdatetocomponentDidUpdate. This fixes the following warning from the console: