DEV Community

Discussion on: React Form using Formik, Material-UI and Yup.

Collapse
 
bishbashbosh123 profile image
James Robinson

Predictably, about 10 seconds after posting that comment I found out what the problem was. Looking at the withStyles() docs, I can see that this:

const classes = this.props;

should be...

const {classes} = this.props;

It did seem strange at the time that withStyles would replace all props to the component, rather than just add to them.

Collapse
 
finallynero profile image
Nero Adaware

withStyles will not replace all the props to that component, it should just add to them.