Skip to content

React 19: 'ConfettiBoom' cannot be used as a JSX componentΒ #1

@joshuajung

Description

@joshuajung

In React 19, using the ConfettiBoom component (great work btw.!) triggers a TypeScript error:

error TS2786: 'ConfettiBoom' cannot be used as a JSX component.
  Its type '(props: Props) => Element' is not a valid JSX element type.
    Type '(props: Props) => Element' is not assignable to type '(props: any) => 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'.

To reproduce, simply set up a project using React 19 and add the above component. Everything was working fine in React 18.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions