Welcome to the demonstration project for Sigma School's React lesson, focusing specifically on the use of React's useEffect
hook. This educational tool is designed to showcase how useEffect
can be leveraged to perform side effects in your components, such as data fetching, subscriptions, or manually changing the DOM in React applications.
This project provides a practical example to help students understand and implement React's useEffect
hook. By exploring this project, students will gain insights into how useEffect
works and how it can be used to enhance functionality and user experience in a React application. The project uses the https://sg-bus-arrivals-sigma-schoolsc1.replit.app/?id=${id} to fetch real-time bus arrival data, which demonstrates effective use of useEffect
for API calls.
Experience the live version of the project here: Bus Arrival App Demo
Through this project, students will learn:
- How to use the
useEffect
hook to handle side effects in React components. - Techniques for fetching data and updating the state upon component mounting and updates.
- Best practices for cleaning up effects to prevent memory leaks.
To start working with this project, clone the repository to your local machine:
git clone https://github.com/mjcoding0702/bus-arrival-app.git
After cloning, change your directory:
cd bus-arrival-app
Install the necessary dependencies:
npm install
Run the project locally:
npm run dev
Contributions to this project are welcome! If you have suggestions to improve it or want to add new features, please feel free to make a pull request or open an issue.
This project is licensed under the MIT License - see the LICENSE.md file for details.