Returns the data from a route loader. The loader must be defined in the same file as the component using it.
Loaders automatically refetch when:
/home → /about)/user/1 → /user/2)/search?q=hello → /search?q=world)Use useLoader when:
For more advanced use cases like manual refetching, loading states, or accessing refetch from child components, see useLoaderState.
The hook is fully typed based on your loader’s return type:
Edit this page on GitHub.