这是我正在使用的material-ui的版本:
"@mui/icons-material": "^5.5.1",
"@mui/material": "^5.5.1",
这就是我导入 Button 组件的方式:
import Button from "@mui/material/Button";
这就是我使用 Button 的方式:
<Button variant="contained"
className={styles.contactBtn}
autoFocus
onClick={handleClose}
>
Close
</Button>
我收到这样的错误:无法读取 null 的属性(读取“脉冲”)
我从 github Link 找到了这个线程(解决方案) ,但它并没有解决我的问题。 我该如何解决这个问题?
最佳答案
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>
关于javascript - 无法在 material-ui Button 组件中读取 null 的属性(读取 'pulsate'),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72151481/