atomicdata-dev/atomic-server

Upgrade to React 19

Closed this issue · 1 comments

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

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.