Answers for "Material-UI: A component is changing the default value state of an uncontrolled Select after being initialized. To suppress this warning opt to use a controlled Select."

1

Material-UI: A component is changing the default value state of an uncontrolled Select after being initialized. To suppress this warning opt to use a controlled Select.

/** Uncontrolled here means you may be setting the value
of the Select component to undefined, this is because 
value={props.selectedValue} here. In this the props or 
selectedValue may come null so it turns out to be a
uncontrolled component in that.
To solve the warning you can add condition to check null 
and set default value.
*/

value={props.selectedValue ? props.selectedValue : " "}
Posted by: Guest on June-29-2021

Code answers related to "Material-UI: A component is changing the default value state of an uncontrolled Select after being initialized. To suppress this warning opt to use a controlled Select."

Code answers related to "Javascript"

Browse Popular Code Answers by Language