I'm currently developing a webpage using React and Material-UI. One of the components I have is a TextField element, and I need to remove the arrow buttons that typically appear on number input fields. If I were utilizing CSS, I could easily achieve this with the following code:
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
However, since I want to style the page using CSS in JS, specifically by employing
export default withStyles(styles)(FormPersonalDetails)
, I am presented with a new challenge. So, how can I accomplish this task?
const styles = theme => ({
number: {
// Add your styling here //
}
});
Within the render() function:
const { classes } = this.props;
return (
<TextField className={classes.number} />
)