Warning: Failed prop type: Invalid prop `error` of type `string` supplied to `ForwardRef(FormControl)`, expected `boolean`

Viewed 3396

I have a material-ui Textfield component in my ReactJS project.

When I run my code, the warning I got in the console is:

Warning: Failed prop type: Invalid prop `error` of type `string` supplied to `ForwardRef(FormControl)`, expected `boolean`.

My component code is below. <Field label="First Name*" name="firstName" component={InputField} type="text" placeholder="First Name" className="form-control" /> This code works totally fine but the problem is that it gives a warning message in the console.

Warning: Failed prop type: Invalid prop error of type string supplied to ForwardRef(TextField), expected boolean.

Is there any ES6 or any other solution to this?

2 Answers

I had a similar error, I solved changing the default value for a non-empty string

you can set the value to null if the not found or undefined

Related