Skip to content

Commit

Permalink
Deprecate useRouteData (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa authored Jan 12, 2023
1 parent 8109df0 commit a4e87f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/react/use-route-data.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { useMatches } from "@remix-run/react";

/**
* @deprecated Use the `useRouteLoaderData` hook from `@remix-run/react`.
*/
export function useRouteData<Data>(routeId: string): Data | undefined {
return useMatches().find((match) => match.id === routeId)?.data as
| Data
Expand Down

0 comments on commit a4e87f0

Please sign in to comment.