Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save davidystephenson/c7d2531b9897a9f9137b7d6feb039b5e to your computer and use it in GitHub Desktop.

Select an option

Save davidystephenson/c7d2531b9897a9f9137b7d6feb039b5e to your computer and use it in GitHub Desktop.
1. Create a TypeScript/React app with Vite.
2. Define a CounterList component:
1. Define a state variable that initializes with an empty array.
2. Render a button that adds a new number to the array that matches the current length of the array.
3. Render the list of numbers in a bulleted list.
Bonus: Inside CounterList, render another button that adds 1 to the last element of the array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment