-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
TypeError of Dialog
and Dialog.Title
from the official example
#2117
Comments
I found the problem, which is because I originally set
After I changed it to But I still want to use |
Hey! Thank you for your bug report! Can you create a minimal reproduction repo and attach it to the issue? |
@RobinMalfait Hey, here it is So basically it's because I set |
@RobinMalfait Hey, sorry to bother you, but I can see the "Needs more info" tag is still there, not sure if my update has been seen. |
We use named imports, but we have to import `React` itself as well for JSX because it compiles to `React.createElement`. We could get rid of our own JSX and use it directly, or we can use this `import * as React from 'react'` syntax. This fixes an issue for people using `allowSyntheticDefaultImports: false` in TypeScript. Fixes: #2117
* use the `import * as React from 'react'` pattern We use named imports, but we have to import `React` itself as well for JSX because it compiles to `React.createElement`. We could get rid of our own JSX and use it directly, or we can use this `import * as React from 'react'` syntax. This fixes an issue for people using `allowSyntheticDefaultImports: false` in TypeScript. Fixes: #2117 * update changelog
This should be fixed, and will be available in the next release. You can already try it using:
|
The changes applied to fix this issue broke some existing applications. Re-opened the issue for now so that we can keep track of it. If we can't find a solution that both fixes this issue and keeps the existing applications from working than this issue will be closed with a "Won't fix". |
I don't immediately see a way for us to fix this without breaking existing applications. Going to close it for now, but maybe pick this up later when necessary. For now you have 2 options I think:
Sorry for the inconvenience, hope this helps! |
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v1.7.7
What browser are you using?
Chrome v108
Reproduction URL
https://headlessui.com/react/dialog 's main example
My screenshots below used totally the same copy-pasted code without any modification
Describe your issue
TypeScript version: ^4.9.4,
Vite: ^4.0.2,
All packages' versions are the latest
className
throwing TypeError ifas
has been set (it works ifas
is not defined)tsc --noEmit
resultThe text was updated successfully, but these errors were encountered: