A simple and functional stopwatch app built with React. This app allows you to start, stop, and reset a timer, with the time displayed in a clean MM:SS
format. Built as a standalone React application using Create React App.
- ⏯️ Start, Stop, and Reset the timer
- 🕒 Displays time in
MM:SS
format - ✅ Conditional message when timer is running
- 🧹 Interval cleanup using
useEffect
to avoid stacking - ⚛️ Built with React Hooks (
useState
,useEffect
)
12-stopwatch-timer/
├── public/
│ └── index.html
│
├── src/
│ ├── App.js
│ ├── index.js
│ └── App.css (optional / remove if not used)
│
├── package.json
└── README.md
- React.js (via Create React App)
- JavaScript (ES6+)
- React Hooks:
useState
,useEffect
- CSS (inline or optional
App.css
) - Git & GitHub
- Clone the repo
git clone https://github.com/abhishekdevelops/12-stopwatch-timer.git
cd 12-stopwatch-timer
- Install dependencies
npm install
- Start the development server
npm start
App will run at: http://localhost:3000
Click Start to begin the timer, Stop to pause, and Reset to return to 00:00.
A message appears below the timer while it’s actively running.
🔗 Live Demo: https://stopwatch-timer-psi.vercel.app/
- How to manage intervals in React
- How to prevent memory leaks using
clearInterval
anduseEffect
cleanup - Formatting time from seconds to MM:SS
- Managing React component state in real-time apps
This app is part of my React Projects Portfolio.