react-helmet icon indicating copy to clipboard operation
react-helmet copied to clipboard

Warning 'UNSAFE_componentWillMount', How to fix the problem?

Open hozaifa4you opened this issue 3 years ago • 4 comments

Helmet Error 1 Helmet Error 2

Warning facing whine I am using react-helmet.

Warnings -> `Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

  • Move code with side effects to componentDidMount, and set initial state in the constructor.

Please update the following components: SideEffect(NullComponent)`

hozaifa4you avatar Nov 17 '22 13:11 hozaifa4you

How to fix the warning without removing <React.StrictMode>??

hozaifa4you avatar Nov 17 '22 13:11 hozaifa4you

I had the same problem, and since I needed to reference the script script in the component, I had a hard time deciding. REACT-HELMET still being updated by anyone else?

PunkFleet avatar Nov 20 '22 03:11 PunkFleet

Do not use this package if you use a relatively modern react version (16+). Use react-helmet-async instead. No other solution afaik unless you are fine with not using strict mode (you should)

sebastiangraz avatar Nov 29 '22 12:11 sebastiangraz

Duplicate from #548

mcrisostomo avatar Jan 10 '24 16:01 mcrisostomo