Skip to content

Compile Error "Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal' #235

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

Open
LucyGit opened this issue Dec 24, 2024 · 2 comments

Comments

@LucyGit
Copy link

LucyGit commented Dec 24, 2024

I used @vscode-elements/react-elements 0.5.0.
When I upgrated react to 19.0.0, and run "tsc -b" I got the following error:

src/components/AuthTable.tsx:265:38 - error TS2786: 'VscodeCheckbox' cannot be used as a JSX component.
  Its type 'ReactWebComponent<VscodeCheckbox, { onChange: EventName<Event>; }>' is not a valid JSX element type.
    Type 'ForwardRefExoticComponent<Omit<HTMLAttributes<VscodeCheckbox>, "name" | "type" | "defaultChecked" | "onChange" | "disabled" | "focused" | "invalid" | "label" | "required" | ... 24 more ... | "update"> & EventListeners<...> & Partial<...> & RefAttributes<...>>' is not assignable to type '(props: any) => ReactNode | Promise<ReactNode>'.
      Type 'ReactNode' is not assignable to type 'ReactNode | Promise<ReactNode>'.
        Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode | Promise<ReactNode>'.
          Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.
@bendera
Copy link
Member

bendera commented Dec 27, 2024

From React 19 you don't need to use this React wrapper package, as web components are fully supported. I haven't had a chance to try how it works in practice, but when I have time I'll update the docs. There is an article about this topic. I would appreciate it if you could share your experiences.

@bendera
Copy link
Member

bendera commented Jan 7, 2025

@LucyGit

I'm working on a React example app, you can check it here:
https://github.com/vscode-elements/examples/tree/react-vite/react-vite

I also created a type definition. It looks good: https://github.com/vscode-elements/examples/blob/react-vite/react-vite/src/global.d.ts

Documentation will be updated later.

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

No branches or pull requests

2 participants