You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Typescript together with React 19rc. It appears that the new dialog element has not been added to the @types/react. I did try and add a types.d.ts file with the Intrinsics def but that does nothing.
Hey, I noticed the same issue while working with React 19rc and TypeScript. It seems like the dialog element hasn’t been added to @types/react yet. One workaround that’s helped me is manually extending the IntrinsicElements in a types.d.ts file. Here’s a quick snippet that might help:
This should temporarily fix the TypeScript error for now until the types package is updated. I’m also looking into submitting a PR to address this. Let me know if this works for you!
This element is typed for 7 years now and works on minimal apps:
<dialogopen/>
Playground Link
There's likely something else wrong. Does the same error occur when you just use div? Are you sure the right tsconfig with support for JSX is being used?
For us to be able to help, we'd need a minimal reproduction that we an clone. Or a TypeScript Playground
I am using Typescript together with React 19rc. It appears that the new dialog element has not been added to the @types/react. I did try and add a types.d.ts file with the Intrinsics def but that does nothing.
This is the entire source code but on the affected file itself, https://github.com/PacktPublishing/Full-Stack-React-TypeScript-and-Node-2nd-Edition/blob/chap5/Final/blog/client/src/common/components/modals/Modal.ts
The text was updated successfully, but these errors were encountered: