React-helmet: Use of Deprecated `componentWillMount` Method

Created on 28 Oct 2019  路  2Comments  路  Source: nfl/react-helmet

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
I get this warning any time I use <Helmet>:

Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles 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: SideEffect(NullComponent)

I assure this has nothing to do with my own code. Without react-helmet, the console has nothing to complain about. So I believe that react-helmet needs to be updated to not use componentWillMount.

If the current behavior is a bug,
please provide the steps to reproduce and if
possible a minimal demo of the problem.
Your bug will get fixed much faster if we can run your
code and it doesn't have dependencies other than React and react-helmet.
Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or
CodeSandbox (https://codesandbox.io/s/new) example below:

Run this demo and check the console for a warning:
https://codesandbox.io/s/epic-sun-28y0e

What is the expected behavior?
See the warning above that pops up in the console.

Which versions of React and react-helmet, and which browser / OS are affected by this issue?

  • React 16.10.2
  • react-helmet 5.2.1
  • Safari 12.1
  • macOS 10.14.4

Did this work in previous versions of React and/or react-helmet?
Not sure; this is the first time I鈥檓 working with react-helmet.

Most helpful comment

Duplicate of #426

All 2 comments

Duplicate of #426

Thanks for everyone's patience. We are actively working on 6.0.0 release. 6.0.0-beta.2 is available and will work with the latest React version.

Was this page helpful?
0 / 5 - 0 ratings