Skip to content

Having Trouble Utilizing <ProtectedRoute /> #2424

Answered by gbj
joeyame asked this question in Q&A
Discussion options

You must be logged in to vote

ProtectedRoute does not work well with async/resources because it only checks the condition once, IIRC. I'd suggest using regular routes, and wrapping the route Outlet in a Suspense that checks the resource and shows the Outlet or not, as in this example: https://book.leptos.dev/router/16_routes.html#conditional-routes

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@joeyame
Comment options

@joeyame
Comment options

@ozpv
Comment options

Answer selected by joeyame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants