Conversation
|
Hi @Owobilum, this is currently under review. could you please leave a comment under the issue? That way, I can assign it to you. Thanks! |
| setUser(user) // store user in state because user is checked to determine private route access | ||
| setLoggedIn(true); | ||
| navigate("/"); | ||
| navigate("/", { state:user }); // store user in route state because "/" route will render with the old user state at this point |
There was a problem hiding this comment.
QQ here. If we update the state via our context as we do a few lines up from this, does route "/" render old user state data? I haven't really used this feature from react router dom, but it looks like its a way to carry state across routes. If so our user context is already doing this, correct?
|
|
||
| function PrivateRoute({ children }) { | ||
| const location = useLocation(); | ||
| const userInLocation = location.state; |
There was a problem hiding this comment.
what's the difference here vs the state we are tracking on userContext?
|
I just have a few questions, it's looking great though! Coming to think of it, we will need additional protected routes but for users who are already signed in, that can't visit pages such as /login, since they are already logged in. This can be taken care of on a different issue! |
|
Hi @Owobilum , any update? |
What does this PR do?