Skip to content

Passing the info prop in a resource fetcher breaks type inference for createResource<T> #1250

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

Closed
ivancuric opened this issue Sep 26, 2022 · 2 comments
Labels
dependencies Pull requests that update a dependency file typescript relating to typescript or types

Comments

@ivancuric
Copy link

ivancuric commented Sep 26, 2022

Describe the bug

Passing the info prop in a resource fetcher breaks type inference for createResource<T> and it's inferred as Resource<unknown>. Without it the type is correctly inferred to be Resource<number | undefined>

Your Example Website or App

https://stackblitz.com/edit/vitejs-vite-wku3ye?file=src%2FApp.tsx

@ivancuric ivancuric changed the title Passing the info prop in a resource fetcher breaks type inference for createResource<T> Passing the info prop in a resource fetcher breaks type inference for createResource<T> Sep 26, 2022
@ryansolid ryansolid added the typescript relating to typescript or types label Sep 26, 2022
@otonashixav
Copy link
Contributor

This is a typescript issue, see microsoft/TypeScript#49618.

@ryansolid ryansolid added the dependencies Pull requests that update a dependency file label Sep 26, 2022
@ryansolid
Copy link
Member

Nothing to be done here and since a fix to TS in the linked bug would just fix this, no action we can take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file typescript relating to typescript or types
Projects
None yet
Development

No branches or pull requests

3 participants