Convert the vanilla‑JS timer from
https://github.com/TTPR-LaGuardia-Community-College/js-lab-switch2-countdown-ttpr
into a state‑driven React app that shows off the component life‑cycle.
| Goal | You will … |
|---|---|
| State | Store changing data with useState and trigger re‑renders. |
| Lifecycle | Start a “tick” when the component mounts, and stop it when it unmounts (useEffect). |
| Props | Feed the launch date as a prop instead of hard‑coding. |
| Declarative UI | Swap to “Switch 2 is out! 🎉” by changing state, not the DOM. |
| Stretch | Play a sound and/or run multiple timers without copy‑pasting logic. |
-
Clone the original repo (for reference only).
-
Scaffold a fresh React project:
// Inside Repo npm create vite@latest switch2-react -- --template react cd switch2-react npm install