Open stefanwuest opened 1 year ago
I'm also struggling with this in Typescript at the moment:
For what it's worth, I'm currently copy and pasting this code here to make it work in my project with superjson: https://github.com/kiliman/remix-superjson/blob/main/app/utils/data.ts
Automatic typing from the
loader
function by passingtypeof loader
touseLoaderData
is not working with this package. It looks likeuseLoaderData
is typed as:when it should be
to conform to how Remix types it.
Expected Behavior When using
useLoaderData<typeof loader>
where the loader function returns from thejson
function of this package, the types should be inferred correctly.