Expected Behavior
Not showing warnings when passing an object as value to the Select component.
Current Behavior
It works but it is showing these warnings:
Warning: Failed prop type: Invalid prop 'value' supplied to 'Select'.
Warning: Failed prop type: Invalid prop 'value' supplied to 'Input'.
Warning: Failed prop type: Invalid prop 'value' supplied to 'SelectInput'.
Steps to Reproduce (for bugs)
Thats my component in which I use the Select component. As you can see this.props.selectedWorkingStep is an object which causes those warnings.
class WorkingStepSelect extends React.Component {
render() {
return <FormControl error={this.props.error} className={this.props.classes.formControl}>
<InputLabel htmlFor="workingStepSelect">{germanMessages.resources.controls.workingStepSelect.label}</InputLabel>
<Select
value={this.props.selectedWorkingStep}
onChange={this.props.onChangeWorkingStep}
input={<Input name="workingStep" id="workingStepSelect" />}
>
{this.props.workingSteps.map((workingStep) => {
return <MenuItem key={workingStep.id} value={workingStep}>{workingStep.name}</MenuItem>
})}
</Select>
<FormHelperText className="error-message" error={this.props.error}>{germanMessages.resources.controls.workingStepSelect.errorMessages[this.props.error]}</FormHelperText>
</FormControl>
}
}
PropTypes:
WorkingStepSelect.propTypes = {
selectedWorkingStep: PropTypes.any,
workingSteps: PropTypes.arrayOf(PropTypes.object),
onChangeWorkingStep: PropTypes.func,
error: PropTypes.any,
classes: PropTypes.object
};
CodeSandbox example
https://codesandbox.io/s/8x8r5plx32?module=%2Fsrc%2Fpages%2Findex.js
Context
Its not that critical because it is working for me(maybe there are errors which I don't encountered yet). Maybe #10834 has the same problem but I don't know it is the same reason for the warning because my warnings show up not depending on if I select an item of the Select.
Your Environment
Expected Behavior
Not showing warnings when passing an object as value to the Select component.
Current Behavior
It works but it is showing these warnings:
Warning: Failed prop type: Invalid prop 'value' supplied to 'Select'.Warning: Failed prop type: Invalid prop 'value' supplied to 'Input'.Warning: Failed prop type: Invalid prop 'value' supplied to 'SelectInput'.Steps to Reproduce (for bugs)
Thats my component in which I use the Select component. As you can see
this.props.selectedWorkingStepis an object which causes those warnings.PropTypes:
CodeSandbox example
https://codesandbox.io/s/8x8r5plx32?module=%2Fsrc%2Fpages%2Findex.js
Context
Its not that critical because it is working for me(maybe there are errors which I don't encountered yet). Maybe #10834 has the same problem but I don't know it is the same reason for the warning because my warnings show up not depending on if I select an item of the Select.
Your Environment