componentWillMount, componentWillReceiveProps are depricated
See original GitHub issueThese 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-lifecycles
in 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-lifecycles
in your project source folder.Please update the following components: HTML
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:11
Top Results From Across the Web
componentWillMount is deprecated and will be removed in the ...
componentDidMount isn't deprecated and is definitely still safe to use, so there's no need to add UNSAFE_ to that method.
Read more >React: componentWillMount to be deprecated! - Northcoders
React: componentWillMount to be deprecated! · All three methods are frequently use incorrectly and there are better alternatives. · When asynchronous rendering is ......
Read more >React.Component
componentDidMount () is invoked immediately after a component is mounted (inserted ... by calling setState , but this will be deprecated in a...
Read more >React17, or how to get rid of “componentWillReceiveProps”?
As you may already know, with the release of React 16.3, some of legacy lifecycles were deprecated. One of the biggest lessons we've...
Read more >Warning: componentWillMount is deprecated · Issue #353
Yes It's. The Warning just says that the componentWillMount is deprecated and will be removed in the next major version. Until you change...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fix available in version
4.2.0
.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.