Full React Tutorial #22 - Exact Match Routes

preview_player
Показать описание
🐱‍💻 🐱‍💻 Course Files:

🐱‍👤🐱‍👤 JOIN THE GANG -

🐱‍💻 🐱‍💻 My Udemy Courses:

🐱‍💻 🐱‍💻 Helpful Links:

🐱‍💻 🐱‍💻 Social Links:
Рекомендации по теме
Комментарии
Автор

Just a heads up for other viewers, with React Router v6 (latest version), the code would look like this:

<div className="content">
<Routes>
<Route path="/" element={<Home />}></Route>
<Route path="/create" element={<Create />}></Route>
</Routes>
</div>

Basically <Switch> has been replaced with <Routes>, and <Route> accepts the element attribute, to which you assign the component you would like to load.

munchybonbon
Автор

Bro, this guy has cliff hangers for react cant stop watching

stevegopop
Автор

Hi Shaun, I think the explanation for partial matching is a bit incorrect at 2:40. /create URL won't match /c route, partial match means partial after every forward slash in the URL. For example, the URL /create/user/123 will match the routes /create or /create/user/, but it won't match any partial word. And this makes more sense because using partial matches, we can nest the routes.

adityaverma
Автор

Hi Shaun, it does seem like in Router6, a lot has changed and the path does work automatically

adeleke
Автор

love this course and also the way you delivered the word "preview" with a flourish at 3:30😊😊 thanks again

StephenBeale
Автор

Shaun, will you include styled components in this tutorial? I'd love to learn about it.

beinyourguard
Автор

If you are working with V6 you also do not need to use the exact in the Route declaration.

zakariabhaibi
Автор

This is excellent, short and to the point! Thank you

wontontech
Автор

Hey Shawn thanks for this :)...

Is there any chance of Coming "Testing React - Typescript with JEST || ENZYME " Course?

sadev
Автор

In addition to @munchyBonbon 's comment, remember to define an 'element' attribute if you're using v6 of react-router-dom:

<Router>
<Routes>
<Route path="/a" element={<div>Hello</div>} />
</Routes>
</Router>

joelmurphy
Автор

You the man! Thanks for the videos. Every other react router video is unclear or some guy from India

anthonycalo
Автор

You are on point, most instructors do not explain what that "exact

infobare
Автор

Hi Shawn, I am really excited to see the final product so I am learning a head by studying your github codes up to lesson 32. And again, thank you for creating these educative and informative series. Cheers

johnmoore
Автор

congrats on a mil, thanks for the content!

ReachByteBurst
Автор

Thank you so much you have cleared all my doubts🥳

rohitdummu
Автор

In recent versions of react-router-dom, the Switch component has been replaced by Routes
function App() {
return (
<Router>
<div className="App">
<Navbar />
<div className="content">
<Routes>
<Route path="/" element={<Home />} />
</Routes>
</div>
</div>
</Router>
);
}

basilm.b
Автор

Always the best instructor <3 god bless you Shaun <3

mohamedmousa
Автор

Amazing!! You clear the things in a very short time

kashmirtechtv
Автор

for the algorithm we need to send this to the world.

tarekghosn
Автор

Please, consider someday to make a playlist on MERN stack

johnconnor