How to pass props to Layout Routes and redirection.
So I have a route where the sidebar and top bar ar the layout routes created using _notation and Outlet component.
Now my both layout components are using a useUserSession Hook where that hook uses Tanstack Query to get the session.
The problem is now I have to call that hook 2 times which is not a problem but unnecessary. And also I can't redirect from the component directly using the use navigate when an error is triggered while rendering this layout component.
But if I use timeout then it works fine but off course not a good approach.
So I am really confused.
0 Replies