React-helmet not working with latest react version along with react hooks.

Author: jineshmehta16Created Apr 4, 2020Updated May 19, 2026

I am getting below error when I use the latest react version along with react Helmet. I am using hooks and trying to use a Helmet as documented. This issue comes only when we build the project but when I run locally Helmet works perfectly fine with React hooks.

Below is the link of error which I am getting in the console:

https://reactjs.org/docs/error-decoder.html/?invariant=321

Request your help to know what can be the possible solution.