These 2 methods should be removed from the code.
WARN Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.
- Move code with side effects to componentDidMount, and set initial state in the constructor.
- Rename componentWillMount to UNSAFE_componentWillMount 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.Please update the following components: HTML
WARN 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-lifecyclesin your project source folder.Please update the following components: HTML
same issue here
I am using react-native0.60.5 and getting warning-
"componentWillReceiveProps is deprecated and will be removed in the next major version".
Can I get confirmation to resolve this issue in the next release, so that I could continue using this library without any problem in the next version of react-native also?
same issue here
.... and same.
and same issue here
same
@ThomasHenrissat Please update
Same here. The issue is in MyProjectName/node_modules/react-native-render-html/src/HTMLImage.js at line 43 and MyProjectName/node_modules/react-native-render-html/src/HTML.js at lines 80 and 88. I added UNSAFE_ to the names on these lines as the warning from React told me. This stops the warning from popping up and seems to work but I'm not sure if this will keep on working if I have to update my project again later. I think React is going to get rid of this option in the future. According to React: "These methods are considered legacy and you should avoid them in new code" (https://reactjs.org/docs/react-component.html).
It looks like a few people have already added pull requests with fixes for this. See:
https://github.com/archriss/react-native-render-html/pull/136
https://github.com/archriss/react-native-render-html/pull/256
https://github.com/archriss/react-native-render-html/pull/297
https://github.com/archriss/react-native-render-html/pull/306
https://github.com/archriss/react-native-render-html/pull/313
I have not gone over the code in all these to see which is best.
same
Fix available in version 4.2.0.
Most helpful comment
Fix available in version
4.2.0.