Access another route's loader data
Is it possible to get another route's loader data? E.g. I'm on a product list page, I want to show links to products and I want some data from the product page's loader
2 Replies
exotic-emerald•2mo ago
I am not sure, but you might be able to import the
Route object of another route, or you can use the getRouteApi util to get it, then you should be able to call Route.useLoaderData
you need to make sure there is a match for that route though, otherwise the useLoaderData might errorsunny-greenOP•2mo ago
Thanks @ferretwithabéret ! I'll try this!