[PSA] There's a known issue with react-helmet and useEffect
See original GitHub issueDescription
When using the new React API useEffect
it causes a maximum call stack size exceeded
error.
Steps to reproduce
Here’s a link to the issue on react-helmet https://github.com/nfl/react-helmet/issues/437
How to fix(?)
One of the suggestions is to upgrade to v6.0.0-beta
Possible bug
However, upon updating and running gatsby develop I ran into this issue
TypeError: Cannot read property 'renderStatic' of undefined
- render-page.js:1546 Object../node_modules/gatsby-plugin-react-helmet/gatsby-ssr.js.exports.onRenderBody
Does this mean we also need to update gatsby-plugin-react-helmet
to use v6.0.0-beta as dependency?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
useEffect Hook not firing function enclosed inside it
I have the following component in my reactjs application ...
Read more >When to Use and When to Avoid Using React Helmet -- newline
React Helmet is a library that helps to manage the document head in React applications. We can use it to change the page...
Read more >A Critique of React's useEffect Hook - Alan Storm
The useEffect function is a React Hook. React Hooks only work with functional components. That is to say, React Hooks will NOT work...
Read more >How to Use React Helmet – With Example Use Case
This is because react-helmet led to a few bugs that resulted in memory leaks and poor data integrity. Suffice it to say, when...
Read more >Search-optimized SPAs with React Helmet - LogRocket Blog
This can be a significant issue for many developers. Server-side rendering (SSR) may solve this problem, but it has its limitations, too. React ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Not too sure how to remove the stale label, but I submitted a PR #12873 yesterday, could somebody take a look?
Yup and here’s the fixed version with updated to v6.0.0-beta: https://codesandbox.io/s/01knpr64jn
That’s a great idea! The gotchas that I came up across with are:
After updating to v6.0.0.beta
gatsby-plugin-react-helmet
import Helmet from 'react-helmet'
intoimport { Helmet } from 'react-helmet'