Skip to main content
100%

[VizStudy]Week6: Menus with React

✓ Published0🌍 Public
Hhotdoujiang
Last edited Oct 27, 2019
Created on Oct 25, 2019
Forked from React Starter

This example demonstrates a pet-selection menu built with React, allowing users to choose among Goldfish, Dog, or Cat from a dropdown. The selected value is tracked via the `useState` hook and displayed in the console, while a custom `Dropdown` component maps over option objects to render `<option>` elements. The app uses ReactDOM to render the interface, with the menu styled at a large font size using `rem` units in the HTML. It relies on React 16.9’s production UMD build and follows a starter-code pattern from a lecture.

AI-generated description

React starter code following Curran's lecture <br>

  • use 'rem' to change font size of menu if 'em' don't works
  • pass in 'options' as property to the dropdown menu function
  • use state to track the selected value
  • set a initial value to the usestate()

Finished!

MIT Licensed

Similar vizzes