[Feature Request] Add documentation about useDisclosure #4675
mxmalykhin
started this conversation in
Feature requests
Replies: 1 comment
-
https://nextui.org/docs/components/modal The docs recommend it here. I have a component that wraps a modal/dialog and looking into using it. I'm seeing properties such as Would love to see some docs about it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
The Modal documentation clearly lacks a mention of the useDisclosure hook, which is used in the code examples. A search for a description of the hook throughout the site also yielded no results. I didn't find it on Google or stackoverflow either.
But I found a README for @nextui-org/use-disclosure in the NextUI repository. It states that this is an internal utility that is not intended for public use. I'm actually surprised, because I haven't seen this anywhere either, when I studied the Modal component documentation with code examples where this hook is used.
The hook seems to be useful when you make a clean component and you don't have to write your own isOpen handler.
However, I see two problems:
Describe the solution you'd like
I see the solution sequentially:
And secondly:
If this hook is for public use, then disclose more information about it in the documentation (including what getButtonProps, getDisclosureProps are and how they work)
If this hook is an internal utility, then remove its use from the code examples in the documentation to avoid misandering other developers
Describe alternatives you've considered
I think it's necessary to do something of what I've suggested, because it can really confuse other developers who are guided by the documentation.
Screenshots or Videos
No response
Beta Was this translation helpful? Give feedback.
All reactions