🌍 Public
Viewing a saved revision (read-only)
50f2fe38f11a4b8ca1dc02f9755a8008
Menus with React
This example shows a pet-selection interface built with React, where users choose from a dropdown menu of goldfish, dog, or cat. It demonstrates state management with React’s `useState` hook, rendering a `<select>` element and dynamically highlighting the selected option. The app uses ReactDOM to render the component tree, with the dropdown options defined as an array of value-label pairs. The selected value is logged to the console, and the interface updates live as the user changes the selection.
AI-generated descriptionReact starter code.