-
-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Description
API Platform version(s) affected: 4.2.2
Description
Typescript error when defining optionText on InputGuesser. Via the SelectArrayInputProps and ChoicesProps the InputGuesser has access to the optionText prop. Functionally it works in modifying the value that's used on the select's options, and a callable also is supported:
How to reproduce
In React Admin define resource with relationship. In the edit form of the resource use the following fields:
<InputGuesser source="company" optionText="name" />
<InputGuesser source="user" optionText={(record) => `${record.firstName} ${record.lastName}`} />Possible Solution
Relates to Typescript being able to resolve down towards all props. Somewhere the traversal gets broken.
Workaround
{/* @ts-ignore */}
<InputGuesser source="company" optionText="name" />Additional Context
Metadata
Metadata
Assignees
Labels
No labels