useAccordion
Last updated
Last updated
The useAccordion hook is used inside the component. This hook handles the collapse logic, inside the Accordion component.
This hook is an internal hook and is not available for the users since it's not exposed as a part of this library.
It doesn't accept any parameters.
It returns the following:
openAccordion
- the current state for the label.
toggle
- a function to toggle the label state.
As you can see above it uses the hook of the React internally for toggling the state of each accordion label.