Replies: 4 comments
-
Update: If the loader function is not typed // No use of LoaderFunction type
export const loader = () => {
//....
} then the type inference works. So what is the best practice here? |
Beta Was this translation helpful? Give feedback.
-
Hey there, It appears that |
Beta Was this translation helpful? Give feedback.
-
This has nothing to do with the arguments though. If the function cannot/should not be typified, this should be explicitly mentioned in the docs. Also, what function type should be used: normal/classic or arrow function? The documentation jumps between these two without giving any explanation. So my question remains, what is the best practice? Thanks |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
Hello all
With a fresh project created using
npx create-remix@latest
the types of data returned fromuseLoaderData<typeof loader>()
is not being inferred at all.Am I missing something obvious here or is this being experienced by others as well?
I also tried to turn off the single fetch feature with the same result.
My expectation was for the data within the React component to be fully typed since the
json
shows the correct types.Dependencies
vite config
types in code
Thanks
Beta Was this translation helpful? Give feedback.
All reactions