Returns the loader data for a given route by ID.
Copy code to clipboard
Remix creates the route IDs automatically. They are simply the path of the route file relative to the app folder without the extension.
Route Filename | Route ID |
---|---|
app/root.tsx | "root" |
app/routes/teams.tsx | "routes/teams" |
app/routes/teams.$id.tsx | "routes/teams.$id" |
Note
- When targeting
routes/_index.tsx
the hook usage will beuseRouteLoaderData('routes/_index')