React protected routes in 4 minutes
ฝัง
- เผยแพร่เมื่อ 19 ก.ย. 2024
- React protected routes with react router version 6.
Instructor: / dennisivy11 / / dennis-ivanov
💬 Follow Appwrite on social media & join our Discord community.
• Twitter: / appwrite
• Discord: appwrite.io/di...
• LinkedIn: / appwrite
I don't have any words I just wanna appreciate you. Just keep spreading your valuable knowledge
😁
What a coincidence that this pops up as I was working on this with Appwrite today 😄
Perfect timing 😁
Thank You bro, less duration with more details
Really fast and efficient , thanks!
I'm so lucky to found your video ❤
😁
easy fast efficient, thanks a lot sir
Hello any ideas why when I did this and user clicked on protected routes even though they are not logged in, a blank white page shows up for milliseconds and then redirects me to the login page
What vs code theme is that? :O
Finally the mouse let you do your thing? 😅
Nice technique for protecting routes, I don't think I realised that you could nest routes within a . Thought it had to be only 🤔
We decided to set a schedule for when he's allowed to make noise. Deal was a win win. 😁
And yea, the Routes nesting is a change made in react router V6 - Dennis Ivy
thank you show much
Thanks ❤
beautifully explained
Glad you liked it :) - Dennis Ivy
Pretty accurate 👍🏻
amazing, thank you very much
😉
nice tutorial, great voice👍
Great
pretty cool
great video, but, how do i protect auth routes?
Is there any issue with the appwrite 14.x version its showing error in createEmailPasswordSession()
You seem to be using an SDK version that is compatible with Appwrite 1.5.x and not 1.4.x. You probably need to use one version before what you're currently using.
In protecting routes i can use loaders?
From what I understand, loaders can only be used if you create your routes with "createBrowserRouter", but either way, this would work the same.
YOu are Awesome
😁
What if I access the login page after the user is set to true?
You would wrap the login page with a parent that doesn't render the page until this check is made. i.e. context api would do this. - Dennis Ivy
@@Appwrite thanks for the reply, will try
What if it takes 20 seconds to fetch the user?
@@alphacentauri8035 show a loader
What is that vs code theme ?
Halcyon Theme
I used appwrite in my flutter app...it was smooth experience with only a problem i am having now about how to make database relationships ...
Any help is appreciated...thank you
Best video but Appwrtite query don't work
Which one?
@@Appwriteabout listdocument
@@Appwrite about ListDocument Query
why do I get an error like this? SyntaxError: Unexpected token '
I think there is no error in my syntax
import { Navigate, Outlet } from "react-router-dom";
const PrivateRoutes = () => {
const { isLogin } = useAuth();
return isLogin ? : ;
};
export default PrivateRoutes;
Looks like you just had an extra “