-
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
TypeScript error on "using private name" or "cannot be named" #2306
Comments
@RobinMalfait any idea why these errors don't show up in the react playground? It should basically be set up in a similar way so I would have expected them to. They definitely pop up in the provided reproduction. |
@thecrypticace hmm, no immediate idea why this happens exactly. A few reasons I can think of but would have to dig deeper to know for sure:
🤔 |
Hey, we've merged #2313 which gets rid of this error. We still consider the interfaces themselves to be "internal" in a sense because we may end up changing the implementation should we come up with a nicer solution than the interfaces. Because of this we've prefixed them all with It'll be available in the next release but in the meantime you can test this out using our insiders build:
|
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v1.7.12
What browser are you using?
N/A (TypeScript issue)
Reproduction URL
Describe your issue
Many types in
@headlessui/react
are not exported.This cause those "using private name" or "type X from module Y but cannot be named" TypeScript error very easily.
I believe that any type the is part of the public API should be exported.
If you concern the number of types exported can be overwhelming,
one way to manage them is by using
namespace
. For example:Another example is when using storybook (I didn't add that to the repro, but this is straight forward):
The text was updated successfully, but these errors were encountered: