Reputation: 1057
im using redux form for react application. im facing this warning in console on rendering of form
warning: Unknown props `initialValue`, `autofill`, `onUpdate`, `valid`, `invalid`, `dirty`, `pristine`, `active`, `touched`, `visited`, `autofilled` on <input> tag. Remove these props from the element.
how to resolve this warning in redux form
Upvotes: 4
Views: 2116
Reputation: 8688
This warning was introduced in React 15.2.0 to prevent people from passing down unnecessary or invalid props. Redux form did this, which probably is why you see the warning. There's a closed issue for it on their issue tracker on GitHub if you want to read more. It should be fixed in this version, so try updating and the warning should go away.
Upvotes: 6
Reputation: 2911
const renderField = field => (
<div>
<input {...field.input}/>
// ^^^^^^------------------ THAT is all you have to add. 👍
{field.touched && field.error && <span>{field.error}</span>}
</div>
)
Upvotes: 2