-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning: componentWillMount is deprecated #353
Comments
As a workaround you can go into 'react-native-reanimated/src/core/createAnimatedComponent.js and change I also haven't had any problems with my animations after moving I believe deleting
|
@jhainaua, that is not a workable solution, you'd need to change the upstream code every time you reinstall or in CI environments and such. |
@jbrodriguez, I apologize for the confusion; I believed that starting the comment with "workaround" would have carried the implications through for the rest of the comment. I've since updated the phrase "workable solution," to "workaround that can solve the problem," as "workaround" implies a temporary fix. Hopefully that language is clearer. In addition; I haven't had the problem you suggested when using my own fork of a repo. It's true that it can cause some extra work when future updates come out (which can be a pain), but it's the best I've come up with when I want to remove an error and don't own the repo. I recognize that my method may be inefficient. Would you be comfortable sharing if you have a better solution or idea? Finally, after checking some of the pull requests, it looks like a solution is also being discussed in pull request #342 . |
@jbrodriguez Until resolved in upstream, this tool can be used to apply the workaround directly in the |
I think that the best workarround, if you know that you are not using ComponentWillMount in your own code, and it's just a library deprecation, is to add an ignore warning at index.js in root directory import { YellowBox } from 'react-native'; //TODO:CHECK NOT USING THIS LIFECYCLE METHODS. Ignoring change of lifecycle react-native |
@cargallo That's not a workaround. It just hides the warning which is not a good thing to do |
Yes It's. The Warning just says that the componentWillMount is deprecated and will be removed in the next major version. Until you change the version of your project you will not have any problem and at that time probably the library will be corrected. That's why I talked about workarround and not solution. |
Unfortunately this is not helping me! I followed the directions but every time I install a dependency it reverts back. |
The fix has been pushed to master, but isn't on npm yet. I would rather not blanket ignore cpm deprecation warnings, in-case any others come along that could be missed. |
The fix seems to be merged in
|
You can use commit hash instead of branch to achieve some sort of locking version:
|
Changes has been merged in 1.3.0. You can close this issue. |
Thanks for this! I was still getting the warning after upgrading, but clearing the transform cache fixed that:
|
Upgrading |
Issue
I'm receiving a warning about
componentWillMount
is deprecated.Versions:
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-reanimated": "^1.1.0",
The text was updated successfully, but these errors were encountered: