SpinTheMic
Pro

Interview practice question

Building a show/hide toggle

Frontend Engineering · React · Beginner

How would you build a button that shows and hides a details section?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Boolean state with useState.
  • Toggle with functional update.
  • Conditional rendering.
  • aria-expanded and aria-controls.
  • Consider native details/summary.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics