← Questions

Accessible expand-and-collapse tree in React

0
AppleCodingLast asked Jul 2026

Build a React component that renders nested data as a tree where each node can be expanded or collapsed, to any depth. Render it recursively, keep the expanded state sensibly, and make it accessible: proper roles and ARIA attributes, keyboard navigation (arrows to move, expand and collapse), and visible focus.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding