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

Upgrade to React 19 #1026

Open
Polleps opened this issue Dec 6, 2024 · 1 comment · May be fixed by #1031
Open

Upgrade to React 19 #1026

Polleps opened this issue Dec 6, 2024 · 1 comment · May be fixed by #1031
Assignees
Labels

Comments

@Polleps
Copy link
Member

Polleps commented Dec 6, 2024

React 19 has been released. We should check if it is possible for us to upgrade or if any dependency needs upgrading first. Then we can look into upgrading @tomic/react to react 19 and see if we can use any of the new features like use for example.

There aren't many breaking changes. Most of the breaking changes are legacy features we don't use anyway.
https://react.dev/blog/2024/04/25/react-19-upgrade-guide

@RoelLeijser
Copy link

I’m running into a type compatibility issue with Image. The error indicates that Image's types are incompatible with React 19:

Type error: 'Image' cannot be used as a JSX component.
  Its type 'FC<ImageProps>' is not a valid JSX element type.
    Type 'FunctionComponent<ImageProps>' is not assignable to type '(props: any) => ReactNode'.
      Type 'import("/node_modules/.pnpm/@types+react@18.3.12/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
        Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
          Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.

   7 |   return (
>  8 |       <Image subject={subject} alt={alt} {...props} />
     |        ^
   9 |   );
  10 | };

I think this is related to React changing the jsx namespace as part of the React 19 changes.

@Polleps Polleps self-assigned this Dec 9, 2024
Polleps added a commit that referenced this issue Dec 10, 2024
Polleps added a commit that referenced this issue Jan 22, 2025
Polleps added a commit that referenced this issue Jan 22, 2025
Polleps added a commit that referenced this issue Jan 22, 2025
@Polleps Polleps linked a pull request Jan 22, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants