React Router: Router, Route, and Link

InstructorJoe Maddalone

Share this video with your friends

Send Tweet

In this lesson we'll take our first look at the most common components available to us in react-router; Router, Route, and Link.

Itai
~ 8 years ago

Joe, why didn't you have to use parenthesis around the Links function?

Joe Maddaloneinstructor
~ 8 years ago

"return" is not required in ES6 arrow functions, but rather inferred after the fat arrow. If I had been using an implicit return statement I would have used parens.

const Links = () => "Links" // returns "Links"
const Links = () => {
    return "Links" // implicit return returns "Links"
}
const Links = () => {
    return (
         "Links" // implicit return returns "Links"
    )
}
prabhuignoto
~ 8 years ago

i am having trouble running the examples with react router v4

Bogdan Martinescu
~ 7 years ago

Outdated with React Router v4... Joe should update this course maybe

Byron Lopez
~ 7 years ago

That would be a good idea, I'm struggling with this issue "warning.js:36 Warning: Failed prop type: The prop history is marked as required in Router, but its value is undefined." and also library versions are very old!!

Nick
~ 7 years ago

well this does not work anymore