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 ponent :
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')
I found this thread(solution) from github Link , but it did not solved my issue . How do I fix this ?
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 ponent :
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')
I found this thread(solution) from github Link , but it did not solved my issue . How do I fix this ?
Share Improve this question edited May 7, 2022 at 14:40 Hritik Sharma asked May 7, 2022 at 10:06 Hritik SharmaHritik Sharma 2,0201 gold badge11 silver badges27 bronze badges2 Answers
Reset to default 5I tried removing each prop in button and checked whether it is working or not.
I found, autoFocus prop should have value
true
orfalse
.
It does not set
defaultValue
astrue
orfalse
, ideally it should set adefaultValue
.
<Button variant="contained"
className={styles.contactBtn}
onClick={handleClose}
autoFocus={true}
>
Close
</Button>
autoFocus
should have value true or false. It should not be null.
Read the mui docs for the same. Mui has very well documented the solution to this problem.