🌍 Public
Viewing a saved revision (read-only)
ba7741303c774d2ea5575b7c7fc378b6
Menus with React
This example demonstrates a simple pet selection menu built with React. The interface presents a dropdown list of six pet options, from Dog to Goldfish, with a default selection of Hamster. The app uses React’s `useState` hook to manage the selected value and a reusable `Dropdown` component, which renders the native HTML `<select>` element. Changes to the selection are logged to the console. The component maps over an array of option objects to generate the dropdown entries, relying on React’s `ReactDOM.render` to mount the app.
AI-generated descriptionReact starter code.