我创建了一个包装材料ui select组件的组件。出于某种原因,当我将其传递给样式不适用于组件的“概述”道具时。有什么想法我做错了吗?
export default function FormSelectInput( props ) {
const classes = FormStyle();
return (
<Grid item xs = {props.xs} className = {classes.formItem}>
<FormControl className = {classes.formControl} variant = "outlined">
<InputLabel error = {Validation.isEmpty( props.value )}>{props.label}</InputLabel>
<Select
variant = 'outlined'
// className = {props.className}
label = {props.label}
required = {props.required}
fullWidth
value = {props.value}
onChange = {props.onChange}
input = {<Input />}>
{props.selectInputs.map( (inputName, key) => {
const inputClass = inputName.replace("-","")
return <MenuItem key = {key} value = {inputName} className={classes[inputClass]}>{inputName}</MenuItem>
})}
</Select>
</FormControl>
</Grid>
)
}