Git Product home page Git Product logo

task-react-routing's Introduction

React-Routing

Instructions

Fork this repo and clone

1. Setup

  1. Install react-router and react-router-dom npm install react-router-dom
  2. In index.js import { BrowserRouter } from "react-router-dom";
  3. Wrap the App component with BrowserRouter.

2. Home and List Routes

  1. In App.js, import { Route, Routes } from "react-router-dom";
  2. wrap each compoenent with Route and add exact paths to each one
  3. warp all components with Routes.
  4. test if everyting is working well

3. NavBar UI

  1. create a NavBar component
  2. import { Link } from "react-router-dom";
  3. add Links to redirect you to other components in the app (list, home)

4. Details

  1. add Details component to your App.js and wrap it in Route
  2. the path for this Detail component has to have an id as a param
  3. in ProductItem component wrap the image with a link to take you to the detail component, you should send the id in the path
  4. in detail component get the id from the params and find the cookie using its id

5.Something very kash5a, yet very very easy ๐Ÿ˜Ž Logo

  1. add a logo to your app in the Navbar and place it in the top left
  2. clicking on the logo should always redirect you to home !

Challenge

Right now, your browser tab title is not changing. Make it so that all your pages have a title. HINT: use React Helmet.

task-react-routing's People

Contributors

omsi96 avatar yanalshmilan avatar zainabbaq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.