Skip to content
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

Support for react 19 #239

Open
pouyaafraz123 opened this issue Dec 12, 2024 · 11 comments
Open

Support for react 19 #239

pouyaafraz123 opened this issue Dec 12, 2024 · 11 comments

Comments

@pouyaafraz123
Copy link

No description provided.

@gvillo
Copy link

gvillo commented Dec 13, 2024

+1 getting a warning too

react-helmet-async 2.0.5
└── ✕ unmet peer react@"^16.6.0 || ^17.0.0 || ^18.0.0": found 19.0.0

@lhtdesignde
Copy link

using it with react 19 and didn't see any issues so far. just complains about dependencies. so +1

@vitalyster
Copy link

react 19 have built-in support for metadata tags, see https://react.dev/blog/2024/12/05/react-19#support-for-metadata-tags
This package is not needed anymore

@phoenixstudiodz
Copy link

For some reasons it stopped working when I updated to React 19.
I tested react-helmet-async and react-helmet, there were no errors or warning.

I ended up using React 19 meta tags

@slorber
Copy link
Contributor

slorber commented Dec 30, 2024

react 19 have built-in support for metadata tags, see react.dev/blog/2024/12/05/react-19#support-for-metadata-tags This package is not needed anymore

that's not 100% true

CleanShot 2024-12-30 at 17 23 58

If you rely on some deduplication behavior that this lib provides, React 19 APIs are not a drop-in replacement. For example if I replaced helmet by React 19 APIs in the Docusaurus framework, we'd end up with duplicate head titles because we rely on "deeper" titles to override default titles defined in parent layout components.

CleanShot 2024-12-30 at 17 24 48


There are other things that this library covers that React 19 don't, for example hosting classes / data attributes to the <html> or <body> tags

@vitalyster
Copy link

vitalyster commented Dec 30, 2024

@slorber you not needed a library to do "`${defaultTitle} nested title`" templating. Actually this library can only replace parent title without any advanced templating.

@KyleJune
Copy link

KyleJune commented Jan 1, 2025

This needs a new release for react 19. Shouldn't require anything but bumping the version in the package.json if there are not any breaking changes in react that impact this package.

@antonio-ivanovski
Copy link

react-helmet-async 2.0.5
  └── ✕ unmet peer react@"^16.6.0 || ^17.0.0 || ^18.0.0": found 19.0.0

@slorber
Copy link
Contributor

slorber commented Jan 17, 2025

If anyone finds it helpful, Docusaurus is now running on my v1.3.0 fork, which allows React 19 as peerDeps: "react-helmet-async": "npm:@slorber/[email protected]",. No problem so far.

I didn't fork from v2 since I'm not sure what the breaking changes are. We'll upgrade the fork in the future.

Note: with React 19, I wonder if it's not time to create a new lib that would only be React 19+ and only implement the missing functionalities.

@laug
Copy link

laug commented Jan 31, 2025

React 19 doesn't seem to handle even the most basic of use cases. We do not have any overriding of parent components <title> by child components <title>. However our root HTML file (index.html that loads React) does contain a default <title> tag so that the user sees a title while React is loading. Even in this case, the <title> tag gets duplicated by React 19 once the component loads, and the browser tends to keep the first one, so it is not really usable in practice and Helmet remains very necessary.

@kkovaletp
Copy link

I see 4 issues here, asking for React 19 support, but no PRs.
I'm not a front-end developer, so I cannot measure the complexity of this change: is it too complex for the community to develop it and propose the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants