-
Notifications
You must be signed in to change notification settings - Fork 660
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
Not properly working with new React18 root-api #669
Comments
i can confirm this is an issue with stable react 18 root api. is this project actively maintained? i'd be happy to open a PR if desired. |
I had used the root api 18 with react-helmet@6.1.0 import { createRoot } from 'react-dom/client' const root = createRoot(document.getElementById("root")) found that some of the tags previously added by helmet will be removed by others nested helmet. render(, document.getElementById("root")) the problem disappeared. I can't replicate this problem in simple project in codesandbox, because react router involved. |
Seems like this is a fork that has more traction and is more actively maintained: https://github.com/staylor/react-helmet-async |
Maybe something like that could be used instead, if you don't want to replace packages:
|
I "solved" this problem by adding a Something like:
Not a real solution but only a temporary workaround. You can also probably add the key only to the single tag that needs to be refreshed 🤞 |
I want to report a bug
On the new root-api (reactwg/react-18#5) react-helmet does not always properly set the meta-tags.
Using react-dom@18.0.0-rc.0-f2a59df48-20211208
and react-helmet@6.1.0
I'm not sure if it's related to react-helmet or the current react alpha. But the issue is only noticeable on the new root-api, not when using the old render method on the current alpha.
The text was updated successfully, but these errors were encountered: