This is version of material-ui that I am using :
JavaScript
x
3
1
"@mui/icons-material": "^5.5.1",
2
"@mui/material": "^5.5.1",
3
This is how I imported Button component :
JavaScript
1
2
1
import Button from "@mui/material/Button";
2
This is how I am using Button :
JavaScript
1
8
1
<Button variant="contained"
2
className={styles.contactBtn}
3
autoFocus
4
onClick={handleClose}
5
>
6
Close
7
</Button>
8
I am getting an error like this : Cannot read properties of null (reading ‘pulsate’)
I found this thread(solution) from github Link , but it did not solved my issue . How do I fix this ?
Advertisement
Answer
I tried removing each prop in button and checked whether it is working or not.
I found, button works without autoFocus prop.
JavaScript
1
7
1
<Button variant="contained"
2
className={styles.contactBtn}
3
onClick={handleClose}
4
>
5
Close
6
</Button>
7