Redirecting with dynamic slug
How are you supposed to navigate with type safety to a path with dynamic slug?
i.e. lets say I have a route
/org/$slug/dashboard which checks some state in beforeLoad or loader and decides to redirect to /org/${params.slug}/onboarding.
I get type errors doing the following:
Type '/org/${string}/onboarding' is not assignable to type '"/org/$slug/onboarding"1 Reply
complex-teal•9mo ago
don't do the string interpolation
redirect({ to: '/org/$slug/dashboard', params :{slug:'foo'}})