- I've been attempting to adjust the color of checkboxes and radio buttons.
After conducting some research, I stumbled upon this helpful link: Material UI change Input's active color
Unfortunately, I keep encountering the following error:
(0 , _styles2.createMuiTheme) is not a function
- Could someone guide me on how to modify checkbox colors for use in other areas?
https://codesandbox.io/s/m7z2l1j09y
const theme = createMuiTheme({
palette: {
secondary: {
main: "#E33E7F"
},
formControl: {
color: "black"
}
}
});
<MuiThemeProvider theme={theme}>
<FormControl component="fieldset" className={classes.formControl}>
<FormLabel component="legend">Gender</FormLabel>
<RadioGroup
aria-label="Gender"
name="gender1"
className={classes.group}
value={this.state.value}
onChange={this.handleChange}
>
{radioValues.map(radio => {
return (
<FormControlLabel
value={radio.value}
control={<Radio />}
label={radio.label}
/>
);
})}
</RadioGroup>
{checkBoxvalues.map((check, index) => {
return (
<FormControlLabel
key={check.value}
control={
<Checkbox
checked={check.checked}
onChange={this.handleCheckBoxChange(check.value, index)}
value={check.value}
/>
}
label={check.label}
/>
);
})}
</FormControl>
</MuiThemeProvider>