I'm new to React. How can I fix this.? when className added the error shown. My Employees.js file is,
import classes from '*.module.css';
import { Paper, makeStyles } from '@material-ui/core';
import React from 'react';
import EmployeeForm from './EmployeeForm';
const useStyles = makeStyles(theme =>({
pageContent:{
margin:theme.spacing(5),
padding:theme.spacing(3)
}
}))
export default function Employees(){
return(
<>
<Paper className={classes.pageContent}>
<EmployeeForm />
</Paper>
</>
)
}
The error is,
Module not found: Can't resolve '*.module.css' in 'C:\Users\react_ui\src\Pages\Employees'
The error is because you are importing module.css incorrectly
replace your line no.1 with this import "./module.css"
and make sure your module.css is in the same directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With