Skip to content
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

Use of Deprecated componentWillMount Method #483

Closed
jkantner opened this issue Oct 28, 2019 · 2 comments
Closed

Use of Deprecated componentWillMount Method #483

jkantner opened this issue Oct 28, 2019 · 2 comments

Comments

@jkantner
Copy link

jkantner commented Oct 28, 2019

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’m working with react-helmet.

@jkantner jkantner changed the title Warning Regards componentWillMount Use of Obsolete componentWillMount Method Oct 28, 2019
@jkantner jkantner changed the title Use of Obsolete componentWillMount Method Use of Deprecated componentWillMount Method Oct 28, 2019
@StorytellerCZ
Copy link

Duplicate of #426

@cwelch5
Copy link
Contributor

cwelch5 commented Jan 27, 2020

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.

@cwelch5 cwelch5 closed this as completed Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants