Layout with redirect to child route
Hey! I'm in the simple situation with a
/layout route with some html and two child /layout/a and /layout/b
I'd like to set a redirect on the parent /layout to the child /layout/a, how can I do that?5 Replies
frail-apricot•2y ago
fascinating-indigo•2y ago
Why are you redirecting via loader instead of beforeLoad?
Isn't the loader of foo also called when foo/a is visited?
frail-apricot•2y ago
Its a matter of preference.
I tend to have other checks happening in my beforeLoad callback, so I do my actual "work" for the route in the
loader whilst leaving stuff like preflight-checks to be done in the beforeLoad callback.
It shouldn't really matter in the grand-scheme of things.fascinating-indigo•2y ago
Ok, thank you @Sean Cassiere. I tested it, it's a really good solution.👍🏽
skilled-limeOP•2y ago
Thank you 😄