defineLoader
(for single fetch) and custom context
#9508
Unanswered
DerJacques
asked this question in
Q&A
Replies: 1 comment
-
You need to customize the AppLoadContext in your app, then defineLoader should give you the correct type, see https://sergiodxa.com/tutorials/customize-remix-app-load-context-type |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently investigating the new single fetch functionality and am running into type issues with my custom context provided via the express adapter.
Previously, I had something like this:
In order to get the right types for single fetch loaders, I need to use the new
defineLoader
method.This does not work:
Error:
In an ideal world, I would love for
defineLoader
to take a generic that allows me to provide the context type. Is there any other way I could achieve this?Beta Was this translation helpful? Give feedback.
All reactions