useAccordion
The useAccordion hook is used inside the Accordion 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.
Code
Explanation
As you can see above it uses the useState hook of the React internally for toggling the state of each accordion label.
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.
Last updated