ReactJS Basics - #15 React Router - Route Setup

preview_player
Показать описание
For a SPA, you need a Router. ReactJS Router is a powerful Router which allows you to create & use Routes in your app!

----------

----------

• Follow @maxedapps and @academind_real on Twitter

See you in the videos!

----------

Рекомендации по теме
Комментарии
Автор

I wish I knew this tutorial was no longer relevant before I started. React Router v4 is so much easier to use and none of this tutorial applies anymore.

zoommair
Автор

Best teacher ever. If you dislike any of these videos, you have issues.

otolulope
Автор

You are one of the best teachers in the world, Maximiliam. I love your tutos.

cesarsc
Автор

For those of you who are getting error on using multiple routes for the router, kindly enclose your route tags inside a switch component and then enclose the switch inside BrowserRouter. This worked for me on my react-router-dom version 4.3.1

പോളിമച്ചാൻ
Автор

All, please note that he is using React Router 3 during this video. So, in your package.json dependencies, revise "react-router" so it says ""react-router": "^3.0.0" and then run npm install. Alternative option is to learn React Router 4. However, installing version 3 will allow you to follow this video. Cheers!

bogoodski
Автор

Instead of "home-single", you should've called it "home-alone" :) Great video! Thanks for taking the time to teach others

AllTheJCs
Автор

You are very pleasant to listen too :) Very interesting and educational videos! Keep it up.

VanGestelJasper
Автор

React Router is awesome. Better than the routing in angular i think? haha. Thanks. You're a very good teacher. I've learned so much because of your tutorials.

ralphlargo
Автор

Thank you very much, so far have been learning the basics quite well.

StealWhoWhenAndWhat
Автор

Hi Max, you're doing some great job with this course !!Nice hair cut !!!

adamasy
Автор

Purchased his course on Udemy. Bests Reactjs tutor in the world. Thanks Max.

Tanzeel
Автор

Thank you for all the videos, they're awesome! Really well structured and all the details are explained with good examples :)

fantuns
Автор

You are really good at teaching, thank you for this awesome video, clear as crystal.

kidder
Автор

This works for me at the time of posting, using react-router-dom and importing
import { BrowserRouter as Router, Route, browserHistory } from "react-router-dom":

return (
<Router history={browserHistory}>
<Root>
<Route path='/user' component={User} />
<Route path='/home' component={Home} />
</Root>
</Router>
);

JonasTStefansson
Автор

Hi, I am using
this.props.history.push({
pathname:`some path`,
state:{ object :object}
}) ;
on handleSubmit click
And reading the data into routed component like


This is working fine when I am using BrowserRouter even when i refresh the page i get the values on page BUT when I am using Hashrouter and I refresh the page I get error saying
Can not read properties of undefined

Please help

shyamsoni
Автор

Probably the best React tutorials on YouTube!
A brief question: So to be able to use pretty urls with react-router on localhost we use the api-history-fallback param in webpack. How do I do that on an actual hosting - namecheap/godaddy/etc?

hypncil
Автор

Oh! You had a haircut! :) Looks good on you teacher. Thanks for the series!

angelbein
Автор

Academind, This video shows the basics really well, easy to follow and why you have a # I think was also good to mention.

Wook
Автор

Hi I'm new to this course coming from your ng2 Udemy course. You're a great instructor for sure. I'm jumping to your latest video to ask this. When might we expect this course to finish up? Are they prerecorded and you're just uploading them on a schedule? Could I maybe find/buy the entire course elsewhere?

itsjhn
Автор

Academind, I am doing a website on CruiseShips at the moment, but I am not sure how to do one of these routes for different Cruise Lines.
I am getting the Cruise Lines from migration database with a knex seeds table. Just to be clear I will have /cruise_line, so the Cruise Line can change.
Some examples are /royalcaribbean or /princess, so you can see that the path name changes, are you able to please show me how I can manage this?

Wook