Skip to content
Advertisement

Cannot read properties of null (reading ‘pulsate’) in material-ui Button component

This is version of material-ui that I am using :

"@mui/icons-material": "^5.5.1",
"@mui/material": "^5.5.1",

This is how I imported Button component :

import Button from "@mui/material/Button";

This is how I am using Button :

<Button variant="contained"
   className={styles.contactBtn}
   autoFocus
   onClick={handleClose}
>
   Close
</Button>

I am getting an error like this : Cannot read properties of null (reading ‘pulsate’)enter image description here

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.

<Button variant="contained"
   className={styles.contactBtn}
   onClick={handleClose}
>
   Close
</Button>
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement