Code Monkey home page Code Monkey logo

saketkothari / jobarouter-react-router-basics Goto Github PK

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

Leverage React Router to seamlessly introduce multiple pages into your React applications. This implementation explores advanced and up-to-date features, including loaders, error components, the newly introduced Form component, and interactive actions.

Home Page: https://jobarouter-react.vercel.app/

HTML 10.62% JavaScript 74.55% CSS 14.83%
breadcrumbs loader react-router

jobarouter-react-router-basics's Introduction

Jobarouter

Why ?

  • Whenever you make a site using react you're normally making something called a single page application or an SPA for short and what that means is that when we request the website from the server in the browser, the server then sends back just a single HTML page and along with that the react JavaScript code needed to render content and react components onto that page.

  • Now in actual fact you'll be very surprised to know that most websites don't consist just of a single page of content and normally you click on a link in the menu to go to a different page right, so in traditional websites that are not single page applications when we click on one of those links it would send a fresh request to the server for a brand new HTML page but that's not the way that react in general were designed to work instead Single page apps like to handle all of the routing in the browser on the front end and not send any additional requests to the server for new pages.

  • That's where the react router is needed because out of the box react doesn't come loaded with a fully baked front-end routing mechanism so typically when we make react site we install an additional package called react router Dom which allows us to easily handle routing in the browser and the way this works is that when we click on a link to a different page in the website the react router intercepts that request and stops it reaching the server and instead the router swaps out the page content depending on whatever page that we requested where each page is essentially just a react component.

  • This is a really fast process because it's all handled on the front end in the browser and we're not sending requests to the server so that's the why and a bit about the how.

What are we making ?

  • We'll be making a simple react application which lists out a load of jobs and we can click on each job to see the job details we've also got some other Pages like a help page which has a few nested routes as well for additional content you can see at the top of the site we've got some breadcrumbs as well which we'll be making.

  • With a little help from the react router too and aside from all the essentials we've learned about some of the newer react router features such as loaders, error components , forms and actions.

Usage

Install dependencies

npm install

Run

npm start

To run the json server

npm i -g json-server
json-server -p 4000 -w ./data/db.json
http://localhost:4000/careers - See all json data

jobarouter-react-router-basics's People

Contributors

dependabot[bot] avatar saketkothari 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.