🌍 Public
Viewing a saved revision (read-only)
01228ac4319f43b3b603d33c4e307867
Menus with React
This example demonstrates a React-based dropdown menu for selecting a pet type from a predefined list of six options, with the current choice displayed in a large label. It uses React hooks (`useState`) to manage the selected value and renders a reusable `Dropdown` component that maps over an options array to populate a native `<select>` element. The interface relies on React 16.9 and ReactDOM for rendering, with event handlers updating state on change. The initial selection is set to "hamster", and the styling uses plain CSS for large fonts.
AI-generated descriptionReact starter code.