Full React Tutorial #22 - Exact Match Routes
Vložit
- čas přidán 13. 01. 2021
- 🐱💻 🐱💻 Course Files:
+ github.com/iamshaunjp/Complet...
🐱👤🐱👤 JOIN THE GANG -
/ @netninja
🐱💻 🐱💻 My Udemy Courses:
+ Modern JavaScript - www.thenetninja.co.uk/udemy/m...
+ Vue JS & Firebase - www.thenetninja.co.uk/udemy/v...
+ D3.js & Firebase - www.thenetninja.co.uk/udemy/d...
🐱💻 🐱💻 Helpful Links:
+ HTML & CSS Course - • HTML & CSS Crash Cours...
+ Modern JavaScript course - • Modern JavaScript Tuto...
+ Get VS Code - code.visualstudio.com/
🐱💻 🐱💻 Social Links:
Facebook - / thenetninjauk
Twitter - / thenetninjauk
Instagram - / thenetninja
Just a heads up for other viewers, with React Router v6 (latest version), the code would look like this:
Basically has been replaced with , and accepts the element attribute, to which you assign the component you would like to load.
Does this also mean the exact prop isn't needed?
I'm using 6 and my Create page seemed to work fine without it when done like this.
@@bugsyplays3560 ARe u sure u are using v6 in your project, as Switch is throwing an error in v6
@@bugsyplays3560 correct
@@unknownman1 bugsy is referring to the 'exact' part of . In v6 it works with just path
@@unknownman1 remove "switch" and use "routes "instead of switch then use the code shown as above that should solve that problem
Bro, this guy has cliff hangers for react tutorials.....I cant stop watching
Haha, thanks Steve!
who needs netflix when you have netninja on youtube?
Honestly broo😂... I came to learn just React router and I find myself watching the whole tutorial 😂
Hi Shaun, it does seem like in Router6, a lot has changed and the path does work automatically
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.
Shaun, will you include styled components in this tutorial? I'd love to learn about it.
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
You are on point, most instructors do not explain what that "exact
thank you so much for this video! I am new to react and i had some trouble with routes, but you explained it so well in this video and it helped a lot! Keep up the good work!
Hey Shawn thanks for this :)...
Is there any chance of Coming "Testing React - Typescript with JEST || ENZYME " Course?
Amazing!! You clear the things in a very short time
This is excellent, short and to the point! Thank you
Thanks, hope you enjoyed it!
if the Switch tag renders the route component exclusively, why do we need the exact property in the first place? I'm confused.
congrats on a mil, thanks for the content!
Appreciate it! :)
If you are working with V6 you also do not need to use the exact in the Route declaration.
Very good video! Straight to the point!
great tutorials, thanks, it will be good if you include context api in this tutorial with useReducer hook
Ninjas, how can i deploy locally the app if i'm using webpack, i've tried the vscode live server and express server for the index.html but didn't work...
i finally learned the use of exact thank you
Always the best instructor
Agreed. His tutorials are so good.
Thank you so much you have cleared all my doubts🥳
Happy to help Rohit! :)
Thanks a lot for everything literally. THANKS
You the man! Thanks for the videos. Every other react router video is unclear or some guy from India
This is amazing. Good job as always. Thank you Shaun
Thankyou very much sir
Please, consider someday to make a playlist on MERN stack
Thanks
Thanks buddy, I implemented and it worked.
Glad it helped Pranav!
great video!
What about lazy loading a component?
nice stuff!
In addition to @munchyBonbon 's comment, remember to define an 'element' attribute if you're using v6 of react-router-dom:
thank you very much
'useEffect' is defined but never used how could i Solve this error? anyone please help me?
Thank you
It looks for the first address
It finds / so it shows homepage that's why we use exact
thank-you ♥️
THANK YOU SO MUCHHHHH
i love u man !!
Great tutorial's
In recent versions of react-router-dom, the Switch component has been replaced by Routes
function App() {
return (
);
}
I need to sleep and chill WHY AM I SO ADDICTED TO THIS xD
gz to 800k
Good tutorial, can you add à video with router animation?
great! thank you
No worries! thanks for watching :)
thanks
I love you!!!
for the algorithm we need to send this to the world.
ty
Awesome tutorial series
It would be great if we get a video on how to integrate Gpay into our website.
Can u create react-router beta version-6
Is there a better way to route. It seems very tedious to create routing this way. If you have 20 routes, it will be like 60 lines.
did you find a way?
because I have a same problem as well .d
Hey Guys , "Switch" has been Deprecated is there any other alternative?
Use 'Routes' instead of Switch.... just replace every 'Switch' with 'Routes'
good job sir
Which job?
Update in react-router-dom V6
return (
);
compared to nuxt , nuxt is a blessing in this area ! haha
Why wouldn't they just build in the 'exact' property into the 'path' property? That seems unnecessary.
actually /c will not match /create , but /np will match /np/something (things between slashes must be exactly the same )
"Things between slashes" also refers to things after the last slash right?
@@Ridhu try and seeeeeee
Ninja can you do react tutorial on udemy bro ?! PLZ
Ohh 😯 I thought it was all
routerv6 done this by default :D
🙏
Let's save that now and... pRRreview.
React router v6 made routing easier and less code
First
this is no longer needed in v6
plzzzzzzzzzzzzzzzzzzzzzz share the codeeeeeeeeeeeeeeeeeeeee
【2023/6/29】
#NO NEED TO WATCH THIS CLIP.#
I think the content this clip talked about was kind of bug of react routers.
However, they've fixed this problem.
Don't need to watch this video now.
Is not easy to understand the routes, I had to figure out that you already made the hrefs in the navbar point to the routes you were using here
Thanks
thanks
Thanks