You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using shadCN accordion but it lacks the ability to hook into the accordion being opened to show a loading spinner to the user and our accordion is use to load large amount of data.
Is this possible with react-accordion ? From what I can gather it might be a lot easier.
Thanks
Alain
The text was updated successfully, but these errors were encountered:
You can listen to the onStateChange event on the Accordion component. The same event is also available through the useAccordionProvider hook if you're using a ControlledAccordion.
Since onStateChange is an event, you can use it to trigger side effects such as fetching data asynchronously.
Here is the doc link for onStateChange.
And here is a sandbox example that listens to the event on the third item.
I have been using shadCN accordion but it lacks the ability to hook into the accordion being opened to show a loading spinner to the user and our accordion is use to load large amount of data.
Is this possible with react-accordion ? From what I can gather it might be a lot easier.
Thanks
Alain
The text was updated successfully, but these errors were encountered: