🌍 Public
Viewing a saved revision (read-only)
d7aba9d2d829472a92ca2bc73aba0588
Menus with React
This example demonstrates a pet-selection menu built with React, where users choose from a list of animals. It shows a labeled dropdown interface that updates the selected value in response to user interaction. The code uses React’s `useState` hook to track the current selection, and a reusable `Dropdown` component renders the HTML `<select>` element. The dropdown options are defined as an array of objects with value-label pairs, and the selected value defaults to “hamster.” No external data source is used; the options are hardcoded in the component.
AI-generated descriptionReact starter code