🌍 Public
Viewing a saved revision (read-only)
5b5dfa7604ac4adbab34837fb21b22b9
React starter - menu
This example demonstrates a simple pet-selection menu built with React, using a reusable Dropdown component that renders a native HTML `<select>` element. It shows how React state, managed via the `useState` hook, updates the chosen option when a user changes the selection. The `Dropdown.js` file defines the component, mapping over an array of pet options (goldfish, dog, cat, hamster, parrot, spider) and passing the selected value through props. The app is rendered into the DOM using `ReactDOM.render` from React 16.9, with inline styling adjusting the font sizes of the label and select controls.
AI-generated descriptionExample of menus with React