-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add generics for loader data, action data, and fetchers #12180
Conversation
🦋 Changeset detectedLatest commit: 7e47853 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -96,22 +96,24 @@ export interface LinksFunction { | |||
|
|||
export interface MetaMatch< | |||
RouteId extends string = string, | |||
Loader extends LoaderFunction | unknown = unknown | |||
Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed during testing that I'm not sure we ever handled meta
types for clientLoader
. I think as long as we always union with undefined
this should be valid since meta
would have no data on initial render for clientLoader
-only routes.
Hybrid routes are trickier because meta
would have data for the server loader on SSR, and on initial hydration and then would have clientLoader
data subsequently - but I think that's just a userland solution via MetaFunction<typeof loader | typeof clientLoader>
7c6c066
to
8c0a1ca
Compare
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Stacked on #12177
Handles bringing over Remix generics for:
useLoaderData
/useActionData
useFetcher
useRouteLoaderData
meta()
Await
serverLoader
/serverAction
Am I missing anything else?
Available for testing in
0.0.0-experimental-7c6c0664d