🌍 Public
Viewing a saved revision (read-only)
c6948954b0e44a9d892883e263f26cbb
Menus with React
A React page presents a dropdown menu for selecting a pet from a hardcoded list of six options (dog, cat, hamster, parrot, spider, goldfish), with the hamster preselected. It demonstrates state management via React's `useState` hook and a reusable `Dropdown` component that maps over options to render `<option>` elements. The selection updates through an `onSelectedValueChange` callback passed to the component. The example relies on React 16.9 and ReactDOM to render the interface into a single `#root` div, with inline CSS styling for readability.
AI-generated descriptionReact Starter Code