I'm creating an Accordion with react spring, the accordion is ready and working fine, but I can not make it to allow the accordion to open one item at the time, right now open all the three item in the same time, I wish to be able to open only one.
here is the codesand -> https://codesandbox.io/s/prod-sun-ttix7?file=/src/App.tsx
You just have to pull up the open state into the
App
component and and use the key or index as (open) indicator, like this:App component
ServiceItem component
Here is a working example: https://codesandbox.io/s/infallible-banzai-fnncw.