10 - Protected Routes and Authentication with React Router
ฝัง
- เผยแพร่เมื่อ 14 ต.ค. 2024
- ► Check out screencasts.al... for more episodes!
► Learn to build your own production-ready React applications and become a successful React developer: alterclass.io/...
► Be on top of the best and hottest web technologies: alterclass.io/...
--
You'll often need to protect some pages of your application and display them only if the user is authenticated. So, in this lesson, you'll learn how to create a custom and reusable ProtectedRoute component to protect your routes using React Router.
Buy me a coffee: www.buymeacoff...
Simple and clean. Thank you
New to react..how did you implement the sign in/out button? Mind sharing the code? ;)
I am also wondering about it , it seems somehow miser developer`s job :)
And also if you just install npm i react-router and then look at your package.json file it says v6 but this video is all about v5 if you want to install v5 then I suggest you to write npm i react-router-dom@5.0.0 then you will no longer get any errors :)
Clear and precise. Thanks.
it would have been better if you provieded link to your github page
This is outdated. Redirect is depreciated in react router
Replace with Navigate
How to create protected routes in react router v6?
Why are you using outdated react router?
code .... pls
Code please