I want to pass custom properties to my Redux-Form-Field. In the documentation it says:
Any custom props passed to Field will be merged into the props object on the same level as the input and meta objects.
But passing a custom prop to the Field component will throw a compile error:
<Field
name="E-Mail"
component={MaterialTextField}
myProp="Test"
/>
Property 'myProp' does not exist on type '(IntrinsicAttributes & IntrinsicClassAttributes> & ...
Inside the props attribute I can only add a predefined set of properties like placeholder or type. Passing another prop will throw this error:
<Field
name="E-Mail"
component={MaterialTextField}
props = {{
myProps: 'Test'
}}
/>
Type '{ name: "E-Mail"; component: (props: any) => Element; props: { myProps: string; }; }' is not assignable to type '(IntrinsicAttributes & ...
Is there a possibility to pass custom props to the Field component in TypeScript?
redux-form
andreact-redux-form
but those are actually two different frameworks. Which one are you referring to? – Inodorous