🌍 Public
Viewing a saved revision (read-only)
500fd6668c54424788f60e3523d4acc0
23. Menus with React
This example demonstrates a React-based dropdown menu for selecting a pet from a list of six options, with the chosen value displayed in the browser console. It shows how controlled form inputs manage state in React: the `Dropdown` component renders a `<select>` element, and the `useState` hook in the main `App` component tracks the selected value. The code uses ReactDOM to mount the application, and the dropdown’s `onChange` event triggers a state update via the passed `onSelectedValueChange` callback.
AI-generated descriptionReact Starter Code