GithubHelp home page GithubHelp logo

antonv0 / react-router-v5 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 670 KB

Project #49 of Codecademy's Full Stack Engineer Career Path

Home Page: https://react-router-dom-tutorial.netlify.app/

License: MIT License

CSS 9.95% HTML 7.81% JavaScript 82.25%
browser-router dynamic-routing react react-router-dom-v5 redirects routing static-routing uselocation-hook useparams-hook usehistory-hook

react-router-v5's Introduction

React Router Tutorial Exercise

Project #49 from Codecademy's Full Stack Engineer Career Path

By Anton Vlasenko (AntonV0)

Project Outline

This project introduced me to routing - using the current browser URL to determine what content to show a user. React Router v5 was installed, as v6 introduced changes that break the starter code.

What I Learned

  • Installing react-router-dom from the terminal
  • Enabling routing by wrapping contents in the BrowserRouter component
  • Adding routes with the Route component
  • Static routes (without URL parameters, e.g. /users)
  • Dynamic routes (with URL parameters, e.g. /users/:userId)
  • Using the useParams hook to access the values of URL parameters
  • Declaratively redirecting users by rendering the Redirect component
  • Imperatively redirecting users by accessing the history object via the useHistory hook and calling its methods (goForward, goBack, push)
  • Accessing the value of query parameters using the useLocation hook

Please note that in each project, the first commit is always the starter code provided by Codecademy.

react-router-v5's People

Contributors

antonv0 avatar

Stargazers

 avatar

Watchers

 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.