material ui add classes to theme provider code example
Example: use theme in class component material ui
import { withStyles } from "@material-ui/core/styles";
const styles = theme => ({
root: {
backgroundColor: "red"
}
});
class ClassComponent extends Component {
state = {
searchNodes: ""
};
render() {
const { classes } = this.props;
return (
Hello!
);
}
}
export default withStyles(styles, { withTheme: true })(ClassComponent);