Jan Kraus 4/16/2022

How to access Remix route data in other routes

Read Original

This technical article explains how to access data fetched by a loader in one Remix route from another nested route. It details the use of the `useMatches()` hook, provides a custom TypeScript-enabled `useRouteData` utility for type safety, and includes a practical example demonstrating data sharing between parent (`/sales`) and child (`/sales/transactions`) routes.

How to access Remix route data in other routes

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser