Git Product home page Git Product logo

react-router-5-course's Introduction

React Router 5 Course Material

React Router 5 is out at we have this course so you can learn all about it. The course covers basic and advanced topics. We'll be building a Firebase-looking app that has complex nested layouts and interesting problems to solve.

Animated Demo

Download and Install

If you're wondering what's new in React Router 5? Not a lot except internal optimizations and fixes for React 16.x. So you could also think of this as a React Router 4 course since the API is the same. See more info on the React Router 5 release

npm install
npm start

Then go to localhost:8000

Be sure to see notes on Lesson Branches below...

Each Lesson is a Git Branch

To view the code for a given lesson, checkout the appropriate branch name. The branch will have the finished code from that lesson.

Installing lesson branches

All the branches are checked out to your local machine automatically when you do npm install. Just do a git branch to verify and see all branches after.

To view a branch: git checkout [branch-name]


Branch names are minimal for easy typing:

  • 01-basics - JSX Routing with BrowserRouter and Route
  • 02-basics - Route Matching - Inclusive vs Exclusive (exact) and Switch
  • 03-basics - Link (anchors)
  • 04-basics - BrowserRouter vs HashRouter
  • 05-basics - Dynamic (Parameter) Matching
  • 06-basics - Nested Layout Strategy
  • 07-basics - match.url
  • 08-basics - match.path
  • 09-basics - NavLink
  • 10-basics - withRouter HoC
  • 11-basics - Programmatic Navigation (History Object)
  • 12-basics - URL Query Strings
  • 13-advanced - Route Render Methods
  • 14-advanced - React Router - Just Components โ„ข
  • 15-advanced - Authentication Strategy with Context
  • 16-advanced - Authenticated Routes (Dynamic Routes)
  • 17-advanced - Navigation With State
  • 18-advanced - Prompt Before Route Changes
  • 19-advanced - Animating Route Changes (Part One)
  • 20-advanced - Animating Route Changes (Part Two)

Fake Database

Just so we can mimic some data and pretend it's asynchronous, there's a src/database.json. Feel free to add more "Firebase Projects" if you want.

The CSS

I used className. Who cares, it keeps the styling clutter out of the JS files since this is teaching material for routing.

Code Organization

In /src you'll see:

  • layouts for highly re-usable app-wide layouts
  • styles for Sass modules
  • ui is where I like to put re-usable "leaf-types" of components
  • utils is a catch all for React components that are more utilitarian in nature (and less UI in nature) and other general utils.

Any other folders in /src is a section of the site, like /auth and /projects which correspond to localhost:8000/auth etc. I guess I could organize those into a /pages folder, but who likes deep nesting anyways?

react-router-5-course's People

Contributors

bradwestfall 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.