🌍 Public
Viewing a saved revision (read-only)
2a2b101addbc494da4bc571b0c3412b5
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