TanStackT
TanStack2y ago
2 replies
wet-aqua

Is is possible to use the same component for more than one route ?

I am migrating my project from React-Router to TanStack/Router. I have a component X that manages 2 routes /create and /:id/edit and based on the api calls I do inside, I handle the logic. Using TanStack/Router, I noticed that it's not possible to use the hook useLoaderData for each route in the same component. How to handle this problem? Is the only solution to split the logic ?
Was this page helpful?