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 React v18 #163

Closed
outbackStack opened this issue Apr 3, 2022 · 5 comments · Fixed by #164
Closed

Support React v18 #163

outbackStack opened this issue Apr 3, 2022 · 5 comments · Fixed by #164

Comments

@outbackStack
Copy link

Do you plan to upgrade to React 18 to avoid npm dependency conflict?

@andipaetzold
Copy link
Contributor

I just created a PR to add React 18 as a peer dependency: #164
I don't see any change in the new release that would break react-helmet-async.

@igorlino
Copy link

igorlino commented Apr 9, 2022

I dont' have a dependency conflict, but a 2 types of TypeScript errors in my CRA-based application

S2769: No overload matches this call.
  Overload 1 of 2, '(props: ProviderProps | Readonly<ProviderProps>): HelmetProvider', gave the following error.
    Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<HelmetProvider> & Readonly<ProviderProps>'.
  Overload 2 of 2, '(props: ProviderProps, context: any): HelmetProvider', gave the following error.
    Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<HelmetProvider> & Readonly<ProviderProps>'.
    21 | function App() {
    22 |     return (
  > 23 |         <HelmetProvider>
TS2769: No overload matches this call.
  Overload 1 of 2, '(props: HelmetProps | Readonly<HelmetProps>): Helmet', gave the following error.
    Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Helmet> & Readonly<HelmetProps>'.
  Overload 2 of 2, '(props: HelmetProps, context: any): Helmet', gave the following error.
    Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Helmet> & Readonly<HelmetProps>'.
    22 |     return (
    23 |         <HelmetProvider>
  > 24 |             <Helmet>

@igorlino
Copy link

igorlino commented Apr 9, 2022

So, in summary, react-helmet-sync should be migrated also because fo this:

https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-typescript-definitions

This is definitively a blocker for whoever is using TypeScript-based react projects.

@andipaetzold
Copy link
Contributor

@igorlino That's also covered in #164.
If the peer dependency conflict is not an issue for you, I'd recommend using patch-package until the PR is merged and a new version is released.

@suren-atoyan
Copy link

@staylor could you please check 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

Successfully merging a pull request may close this issue.

4 participants