Skip to main content

useAccordionItemEffect

Parameter object

PropTypeDescription
itemKeystring | numberAn explicit key which can be used to expand or close item.
initialEnteredbooleanMake the accordion item expanded when initially mounted. This prop takes precedence over the initialEntered prop of Accordion component.
disabledbooleanWhether the accordion item is disabled.

Return object

PropTypeDescription
itemRefobjectA React ref object to be attached to the item element.
stateTransitionStateThe item state.
toggle(toEnter?: boolean) => voidA function to toggle the item state.
NOTE

As its name suggests, this hook is not pure and should be used only once in each accordion item.