Welcome! In this workshop, we’ll build a simple Football Scoreboard app with React.
- Clone the repo and install dependencies:
npm install
npm run dev- Open the app in your browser (usually http://localhost:5173).
- Open
src/App.jsxin your editor.
👉 All your coding happens only in App.jsx.
The other files (Scoreboard.jsx, PlayButtons.jsx, Controls.jsx, App.css) are already complete.
In App.jsx, you’ll see 5 TODOs:
- TODO(1): Implement
addPoints(team, points) - TODO(2): Implement
reset() - TODO(3): Add
<Scoreboard />for Team A and Team B - TODO(4): Add
<PlayButtons />for both teams - TODO(5): Hook up the
<Controls />reset button
When finished, you’ll have a working scoreboard that lets you:
- Rename each team.
- Add points for touchdowns, field goals, etc.
- Reset the scores.
Scores will show in green (left team) and blue (right team), with styling already included in App.css.
- Use the spread operator
{ ...t }when updating state so you don’t lose properties. - Pass functions as props (
onPlay,onNameChange,onReset) to connect children to parent state. - Don’t worry about CSS today — it’s ready to go.
By the end of the workshop, you’ll understand how to use:
useStateto store values.- Props to pass values and functions.
- Event handlers to update state.
- Components to keep your app organized.
Happy coding! 🎉