-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Typescript: FunctionField without record like data typing limitation #7702
Comments
Hi! <FunctionField<
- Required<PostRecord>['backlinks'][number]
+ Required<PostRecord>['backlinks'][number] & RaRecord
>
source="info"
render={r =>`${r.info.email}`}
/> |
Thank you! @slax57 I will consider to be with workaround while awaiting this issue is fixed :) |
The problem goes beyond I'm not sure how we should fix that. All fields should be able to work on non-records. So at least, for |
What you were expecting:
I tried to give a type definition to a
FunctionField
. As you can see on sandbox below, I gavebacklinks
property as a type which belong toPostRecord
toFunctionField
. However, type error occurs.I assume this type error occurs because
backlinks
type is a type property of thePostRecord
not a record itself.It would be nice if a
FunctionField
would be able to accept another kind of object type than a record.What happened instead:
Related code:
https://codesandbox.io/s/crazy-dan-2x2prk?file=/src/posts/PostShow.tsx (line#58)
Related types
Other information:
Environment
The text was updated successfully, but these errors were encountered: