🌍 Public
Viewing a saved revision (read-only)
6287d8264a2a4110b8e174dc401b0837
Menus with React
This example demonstrates a simple pet-selector interface built with React, where a user can choose a pet from a dropdown menu and the selection is logged to the console. The page starts with the hamster option preselected. The code defines a reusable `Dropdown` component that renders an HTML `<select>` element, mapping over a hardcoded list of options. State management is handled through React’s `useState` hook, with the current value passed back via an `onSelectedValueChange` callback. It utilizes React 16.9 and ReactDOM directly from unpkg CDN.
AI-generated descriptionReact starter code.