[useDisclosure hook] getButtonProps and getDisclosureProps are not documented
See original GitHub issueSubject
useDisclosure
Description
The getButtonProps
and getDisclosureProps
functions returned by the useDisclosure
hook are not mentioned in the documentation, neither are they used in any code example. This is a pity, since they are quite handy 🚀
Can you add some documentation on them with examples on how they could be used?
Thanks!
Issue Analytics
- State:
- Created a year ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
useDisclosure - Chakra UI
useDisclosure is a custom hook used to help handle common open , close , or toggle scenarios. It can be used to control...
Read more >The documentation for useDisclosure hook #2530 - GitHub
When I check the migration guide to V1 about the useDisclosure hook: useDisclosure now accepts object instead of boolean as initial values.
Read more >Using the Chakra-UI useDisclosure hook on both a parent and ...
You can use the hook useDisclosure inside the parent component, then pass the state isOpen and onClose to your child component:
Read more >useDisclosure - Chakra UI - YouTube
"Chakra UI is a simple, modular and accessible component library that gives you the building blocks you need to build your React ...
Read more >Using the Chakra-UI useDisclosure hook on both a ... - Reddit
I am trying to use the Chakra UI useDisclosure hook accross two different components. Basically, I have a parent component with a button...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@TylerAPfledderer We are not merging against
main
anymore. Everything goes into next until v2 is released. Merging it intonext
ist fine, docs will update accordingly once we mergenext
intomain
. If you ment the main repository.I’m going to go ahead and work on a PR to prevent this issue from going stale, and go from there with any review or additional input. 😄
Because these getter methods return specific values, handlers, and state to be passed to a button and the affected component for simple toggling, they can be presented as the “starting point” in the use of this hook, and then discuss the other return props for more refined control.