Build an accordion with three questions where only one answer is open at a time. You practice state shared by several elements and conditional rendering.
ITEMS. Showing each answer (item.body, in a <p> below its question) is up to you.ITEMS: the tests use them.aria-expanded.What is a component? → you see its answer.What is state? → you see that answer and the previous one disappears.Since only one panel can be open, it is enough to remember which one: store its id (or null if none).
Each panel's answer is shown only if its id is the open one.
Pressing the open question sets the open id to null.
The console is empty
Run your code with Ctrl+S
This console starts empty every time the preview loads. The browser's DevTools console keeps the messages with Preserve log.