我Material-UI
在我的项目中使用,我在控制台中收到警告:
Warning: validateDOMNesting(...): <button> cannot appear as a descendant of <button>
即使没有直系后代,
<form>
<TextField
label="Title"
value={title}
onChange={this.handleChange("title")}
className={classes.formControl}
margin="normal"
/>
<br />
<FormControl className={classes.formControl}>
<InputLabel>Muscles</InputLabel>
<Select
value={muscles}
onChange={this.handleChange("muscles")}
>
{categories.map((category, index) => {
return (
<MenuItem key="index" value={category}>
{category}
</MenuItem>
);
})}
</Select>
</FormControl>
<br />
<TextField
multiline
rows={4}
label="Description"
value={description}
onChange={this.handleChange("description")}
className={classes.formControl}
margin="normal"
/>
</form>
这是沙盒链接: