Skip to content

Type mismatch with React 19 #195

@LeopoldArkham

Description

@LeopoldArkham

Hi,

When migrating from React 18 to 19, <DevTools /> give the following error:

'DevTools' cannot be used as a JSX component.
  Its type '(props: DevToolsProps) => Element | null' is not a valid JSX element type.
    Type '(props: DevToolsProps) => Element | null' is not assignable to type '(props: any) => ReactNode | Promise<ReactNode>'.
      Type 'Element | null' is not assignable to type 'ReactNode | Promise<ReactNode>'.
        Type 'Element' is not assignable to type 'ReactNode | Promise<ReactNode>'.
          Property 'children' is missing in type 'ReactElement<any, any>' but required in type 'ReactPortal'.ts(2786)

I assume it needs to be typed as React.ReactNode instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions