# React TDL Demo App
This project is a simple To-Do List (TDL) built with React.
Make sure you have Node.js and npm installed.
- Clone the repository:
git clone https://github.com/Edrzapi/Simple_TDL_React.git cd Simple_TDL_React - Install the dependencies:
npm install
- Run the app:
npm start
Have fun!
Routing Task:
Add Routing to the simple_tdl_app
Your task is to implement routing in the simple_tdl_app to navigate between different pages: Home, About, and 404 (Not Found). You have already been given the 404Page.js, About.js, and Home.js components. Your job is to add routing functionality and ensure proper navigation across these pages.
Steps to Complete the Task:
-
Install React Router
-
If you haven't already installed React Router in the project, run the following command in your terminal to add it:
npm install react-router-dom
-
-
Set Up Routing in
App.js- Open the
App.jsfile. This file will be responsible for managing the routes in your app. - Add routes for the following:
/should render theHomecomponent./aboutshould render theAboutcomponent.- Any other path (404) should render the
404Pagecomponent.
- Open the
-
(Optional) Update Navbar for Navigation
- Create a
Navbar.jsfile and add links to theHomeandAboutpages usingreact-router-dom.
- Create a
-
Test Your Routes
- Start the development server (
npm start) and verify that:- The
/path correctly renders theHomecomponent. - The
/aboutpath correctly renders theAboutcomponent. - Any invalid URL renders the
404Pagecomponent.
- The
- Start the development server (
-
Bonus (Optional)
- Customize the
404Page.jsto display a more user-friendly message like: "Oops! Page not found. Go back to Home." - Use an AppRouter instead of Routes in App.js
- Customize the
Expected Outcomes:
- The app should have routing implemented, allowing users to navigate between the
HomeandAboutpages. - Any invalid route should display the
404Pagecomponent. - The
Navbarshould contain links to navigate between the pages.