🌍 Public
Viewing a saved revision (read-only)
041d85e9decd4ec89428d22e2c13fc78
Menus with React
This example demonstrates a simple pet-selection menu built with React and D3. It shows a labeled dropdown that lets users choose from a list of pets, with the current selection (initially “hamster”) displayed. The interface uses React’s `useState` hook to manage the selected value, while a reusable `Dropdown` component renders the `<select>` element and handles change events. Although D3 v7 is loaded, it is not actively used in this menu’s logic, which relies purely on React’s state and event handling.
AI-generated descriptionReact Starter Code.