This project is part of the Codevixens Frontend Development Challenge (Day 8). A simple stopwatch application built using React. It demonstrates how to manage state, handle events, and use lifecycle methods to create a functional timer.
- State Management: Uses React's
useState
hook to manage the elapsed time and the running state of the stopwatch. - Event Handling: Handles button click events for starting, stopping, and resetting the stopwatch.
- Lifecycle Methods: Uses
useEffect
to manage the timer interval, starting it when the component mounts and clearing it when the component unmounts or when the stopwatch is stopped. - Timer Logic: Implements logic to increment the time every millisecond while the stopwatch is running.
- User Interface: Provides a display for the elapsed time and buttons for Start, Stop, and Reset.
- Styling: Uses CSS to style the application for a visually appealing look.
- Clone the repository:
git clone https://github.com/gideonagyage/Stopwatch-App.git
- Navigate to the project directory:
cd Stopwatch-App
- Install dependencies:
npm install
- Start the development server:
npm start
- Open your browser and navigate to
http://localhost:3000.
The Stopwatch
component is the main component that handles the following:
- State Management: Manages the elapsed time and the running state of the stopwatch using
useState
. - Event Handling: Handles button clicks for Start, Stop, and Reset.
- Timer Logic: Uses
useEffect
to create a timer interval that updates the elapsed time every millisecond. - UI Rendering: Renders the time display and the control buttons.
- Desktop View
- Mobile View
Check out the live demo here.
- State Management: Managing the data and UI state of the React application.
- Event Handling: Responding to user interactions with the application.
- List Rendering: Dynamically rendering lists of data in the React application.
Feel free to fork this repository and submit pull requests. Any contributions are welcome!
This project is licensed under the MIT License.
- Codevixens for organizing the challenge.
- Chinaza Igboanugo, Lois Bassey, and Oyinkansola Shoroye for their contributions and guidance.
Feel free to customize it further to fit your needs! If you have any specific details you'd like to add or change, let me know.