Created
November 30, 2022 04:28
-
-
Save brandonpittman/95a7839bccb7eb8eb5eda03cb97dea58 to your computer and use it in GitHub Desktop.
Helper to grab Remix root loader data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRouteData } from "remix-utils"; | |
import type { SerializeFrom } from "@remix-run/server-runtime"; | |
import type { loader } from "~/root"; | |
export let useRootData = () => | |
useRouteData<SerializeFrom<typeof loader>>("root"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment