Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 1.11 KB

File metadata and controls

20 lines (13 loc) · 1.11 KB

Song Selection

Example of using event-handling, if/else statements, play/pause, and referencing eternal audio (.mp3) tracks to toggle audio on and off.

Task

  1. In this ungraded lab, your goal is to read through the existing code of the App.js file, and update the second button so that it's running the toggle2 function on a click to the seond button.
  2. After adding the toggle2 function to the JSX expression in the second button's onClick event-handling attribute, you should un-comment the bird2 variable on lines 9 to 11.
  3. Next, you need to define the toggle2 function: it should have the exact same functionality as the toggle1 function, but it needs to work with the bird2 variable (instead of the bird1 variable as it does in the toggle1 function).

About this React app

This project was bootstrapped with Create React App.

Setup

  1. Open the built-in terminal
  2. Run npm install to add the node_modules folder
  3. Run npm start
  4. Click the "Open Development server" in the bottom status bar to view the running react app in the browser.