Redirect behaviour on child pages
Hello! I am having some trouble with redirects in Tanstacak Router.
I basicly have some pages set up something like this:
It is not the exact setup, but for this problem it does not matter.
The pages does not have any content, other than a simple div with some simple styling (To apply to all child pages) and an outlet.
I do not want anyone to visit the page since it does not have any real content. I therefore want to redirect the user to .
I have tried to throw a redirect:
Within the beforeLoad, load, and onEnter methods of the route. But either nothing happens, or when the redirect happens, nothing renders on the new page (Even if I refresh).
I understand this is probably something to do with an infinite loop, since it always renders "/dashboard", and therefore redirects. Even if I am on the child pages.
Does anyone know what I have to do?
1 Reply
correct-apricotOP•16mo ago
If I use the Navigate component to navigate to "/dashboard/user", all pages from "/dashboard/" and its child routes, even "/dashboard/admin" redirects to "/dashboard/user"