You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is implying to me that the useFragment requires the fragRef.product to be generated with the corresponding " $data" property. Otherwise, I always have to explicitly provide the ...$key type in order to use useFragment:
Are you observing that a type param is currently required for useFragment in TypeScript? If so, I believe that is expected, and a current limitation. If you have a concrete proposal for a way we could generate types which would avoid that, I'd be open to hearing it.
I'm confused why the generated types from query is missing the " $data" property. Like this:
The above was generated from a
usePreloadedQuery
like thisSo the type for
fragRef.product
would beI think this is wrong.
The
@types/react-relay/relay-hooks/useFragment.d.ts
containsand
@types/react-relay/relay-hooks.helpers.td.ts
containsThis is implying to me that the
useFragment
requires thefragRef.product
to be generated with the corresponding" $data"
property. Otherwise, I always have to explicitly provide the...$key
type in order to useuseFragment
:Without the
<NewProductReviewScreen_ProductFragment$key>
explicitly provided, the return value isunknown
.Versions:
@types/[email protected]
@[email protected]
@[email protected]
The text was updated successfully, but these errors were encountered: