Skip to content

How to get type of loader data #1732

Answered by schiller-manuel
BrendanC23 asked this question in Q&A
Discussion options

You must be logged in to vote

you can try to get the type of the loader data for a route like this:

type LoaderData = RouteById<RegisteredRouter['routeTree'], '/about'>['types']['loaderData']

just be aware this uses internal types that might change.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@schiller-manuel
Comment options

@Andrewy-gh
Comment options

@BrendanC23
Comment options

@schiller-manuel
Comment options

Answer selected by BrendanC23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants