'React Typescript: MUI Accordion - how to implement handleChange for an array?

A beginner here so here goes:- Trying to implement MUI Accordion for an array, the example doesn't show how to implement handleChange() for an array, at the moment it displays the accordion but it is not responding to onChange() at all.

My hunch is that I will have to implement a state hook with a tuple to bind individual accordion components, but I am at lost how to implement this.

I've put my implementation in Demo.tsx (original sample was pulled from MUI Accordion)

My sample code



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source