Skip to content

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

License

Notifications You must be signed in to change notification settings

jt-reference/react_example-song-selection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published