I am using inline styling to override the styling of material-UI components in React. Recently, I realized that using CSS is a more organized and better way to style components. I have referred all the documents on the material-ui user guides. But couldn't find the solution.
Working Code:
const useStyles = theme => ({
input: {
color: '#000',
fontSize: "14px",
},
});
Inside render method of Class.
const { classes } = this.props;
<TextField
InputProps={{
className: classes.input
}}
InputLabelProps={{
className: classes.input
}}
/>
export default withStyles(useStyles)(MyClass);
I want to override style using CSS like below:
CSS File:
.input {
color: #ffffff;
font-size: 18px;
}
InputProps={{
className: "input"
}}
How can I achieve that? Thanks.