Impossible to use custom props in Field component
See original GitHub issueWhen we use custom props in Field component, we have this error.
[ts] Property 'leftIconName' does not exist on type '(IntrinsicAttributes & IntrinsicClassAttributes<Field<FieldAttributes>> & Readonly<{ children?: R...'.
public renderForm = props => (
<form onSubmit={props.handleSubmit}>
<Field
required
component={TextInput}
leftIconName="user"
name="email"
placeholder="example@payfit.fr"
type="email"
/>
<Field
required
component={TextInput}
leftIconName="lock"
name="password"
placeholder="Your password"
type="password"
/>
<Button
className="pt-fill"
iconName="log-in"
intent={Intent.PRIMARY}
loading={props.isSubmitting}
type="submit"
>
Sign in
</Button>
</form>
)
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to pass props to custom components in react-select
It's better to pass custom props via select: props.selectProps. To avoid re-creating of Custom component each time Select updates, ...
Read more >Advanced customization - React Jsonschema form
The following props are passed to a custom field template component: id : The id of the field in the hierarchy. You can...
Read more >Field Components - React-admin - Marmelab
Field Components. A Field component displays a given property of a REST resource. Such components are used in the List and Show views,...
Read more >Field - Redux Form
Object with custom props to pass through the Field component into a component provided to component prop. This props will be merged to...
Read more >Writing your own Components - AdminJS
The methods are split into .add() and .override() as a safety layer, so you don't accidentally override an internal component with a custom...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same error for me when i try to use Fabric components.
but
leftIconName
now is untyped. For exampleTS doesn’t print any errors. In
redux-form
I made such wrappers:and usage: