0
I’m trying to use a custom Component, as the code below, but the same is giving error, someone can give me a light of why is the error happening?
import React from 'react';
import {withStyles, createStyleSheet} from 'material-ui/styles'
import PropTypes from 'prop-types';
import {Drawer} from 'material-ui';
const styleSheet = createStyleSheet({
paper: {
height: 'calc(100% - 64px)',
top: 64
}
})
class CustomDrawer extends React.Component {
render () {
const classes = this.props.classes
return (
<Drawer
classes={{ paper: classes.paper}}
/>
)
}
}
CustomDrawer.propTypes = {
classes: PropTypes.object.isRequired
};
export default withStyles(styleSheet)(CustomDrawer);
This mistake is happening and I don’t understand
Typeerror: Object(...) is not a Function ./src/Components/Customdrawer/Customdrawer.jsx src/Components/Customdrawer/Customdrawer.jsx:
3 | import PropTypes from 'prop-types';
4 | import {Drawer} from 'material-ui';
5 |
> 6 | const styleSheet = createStyleSheet({
7 | paper: {
8 | height: 'calc(100% - 64px)',
9 | top: 64
Please specify version of Material UI.
– nbkhope