🌍 Public
Viewing a saved revision (read-only)
14f65e26a33740a281a561478c808b39
annoted Menus with React
This example demonstrates a dropdown menu for selecting a pet, with the chosen option displayed in the selection field. Built with React, it uses the `useState` hook to track the selected value, initializing it to `hamster`. The `Dropdown` component maps over an options array to render `<option>` elements, marking the current selection with the `selected` attribute. React DOM renders the app into the root element, and the console logs each state change for inspection.
AI-generated descriptionReact starter code.