T
TanStack16mo ago
ratty-blush

Wildcards

Hi all We are faced with issue with migration to react router v6 and thinking about this library It’s possible to use wildcards/regex in paths, like it was done for RR <v6?
5 Replies
genetic-orange
genetic-orange16mo ago
Routing Concepts | TanStack Router React Docs
TanStack Router supports a number of powerful routing concepts that allow you to build complex and dynamic routing systems with ease. The Root Route
genetic-orange
genetic-orange16mo ago
if not, please explain in detail what you want to do
ratty-blush
ratty-blushOP16mo ago
@Manuel Schiller Thank you, i'm just checked by myself via example Actually, i'm talking about something like that
const customRoute = createRoute({
getParentRoute: () => rootRoute,
path: '/${test,grap}/route',
component: function About() {
return <div className="p-2">Hello from customRoute!</div>;
},
});

const custom1Route = createRoute({
getParentRoute: () => rootRoute,
path: '/please/route',
component: function About() {
return <div className="p-2">Hello from please!</div>;
},
});
const customRoute = createRoute({
getParentRoute: () => rootRoute,
path: '/${test,grap}/route',
component: function About() {
return <div className="p-2">Hello from customRoute!</div>;
},
});

const custom1Route = createRoute({
getParentRoute: () => rootRoute,
path: '/please/route',
component: function About() {
return <div className="p-2">Hello from please!</div>;
},
});
And yes, it's work. Thanks But with this changes, types doesn't works(just throwing errors). Is it an issue?
ratty-blush
ratty-blushOP16mo ago
No description
genetic-orange
genetic-orange16mo ago
template string literals are not supported in paths. that aside, I don't understand how ${test,grap} is supposed to work at all.

Did you find this page helpful?