nfl / react-helmet

A document head manager for React
MIT License
17.36k stars 661 forks source link

dependency of react-helmet uses legacy componentWillMount lifecycle method #413

Closed jfrolich closed 4 years ago

jfrolich commented 5 years ago

The dependency react-side-effect uses componentWillMount, so react-helmet will not work in concurrentMode.

jfrolich commented 5 years ago

https://github.com/gaearon/react-side-effect/issues/54

danielweck commented 5 years ago

Looks like react-helmet-async is a useful alternative: https://github.com/staylor/react-helmet-async

goldmont commented 5 years ago

Looks like react-side-effect v2.0.0 now uses UNSAFE_componentWillMount.

Thus, no more warnings in the console.

eduard-malakhov commented 5 years ago

I confirm, after manually upgrading react-side-effect to v2.0.0, the warning is gone.

kevr commented 4 years ago

Looks like react-helmet-async is a useful alternative: https://github.com/staylor/react-helmet-async

No, it's not. Creating another package just to undeprecate something so trivial is not an alternative, it's a cop out.

samuraime commented 4 years ago

before react-helmet update its dependency, a temporary workaround in package.json

  "resolutions": {
    "react-side-effect": "^2.1.0"
  }
cwelch5 commented 4 years ago

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.

dantman commented 4 years ago

so react-helmet will not work in concurrentMode

It doesn't sound like the issue as originally opened was actually fixed. The only difference is a switch from componentWillMount (which emits a depreciation notice and won't work in concurrent mode) was replaced with UNSAFE_componentWillMount (that doesn't emit a deprecation notice; but still does not work in concurrent mode).

miquelvir commented 3 years ago

Why is this closed? Seems that still not working properly (https://github.com/bbc/simorgh/issues/3893#issuecomment-730702092) since we are getting the warning with ^6.1.0.

adamnorbacker commented 3 years ago

@cwelch5 its still the same issue.