Cannot read property 'pulsate' of undefined in ButtonBase component
See original GitHub issueIn some cases, after ‘Esc’ button press, mouse click on ‘IconButton’ throws exception (if pause between press Esc button and mouse click is short).
- This is not a v0.x issue.
- [x ] I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior 🤔
No component crash
Current Behavior 😯
Component crash with error:
Uncaught TypeError: Cannot read property 'pulsate' of undefined
at ButtonBase.componentDidUpdate (ButtonBase.js?0386:268)
at commitLifeCycles (react-dom.development.js?61bb:16879)
at commitAllLifeCycles (react-dom.development.js?61bb:18219)
at HTMLUnknownElement.callCallback (react-dom.development.js?61bb:149)
at Object.invokeGuardedCallbackDev (react-dom.development.js?61bb:199)
at invokeGuardedCallback (react-dom.development.js?61bb:256)
at commitRoot (react-dom.development.js?61bb:18427)
at completeRoot (react-dom.development.js?61bb:19884)
at performWorkOnRoot (react-dom.development.js?61bb:19813)
at performWork (react-dom.development.js?61bb:19721)
Steps to Reproduce 🕹
- Press
Escbutton - Click on IconButton
Context 🔦
Your Environment 🌎
| Tech | Version |
|---|---|
| Material-UI | v3.9.2 |
| React | 16.8.1 |
| Browser | Google chrome |
| TypeScript | yes |
| etc. |
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Cannot read property 'pulsate' of undefined in ButtonBase ...
[x ] I have searched the issues of this repository and believe that this is not a duplicate. Expected Behavior. No component crash....
Read more >Cannot read properties of null (reading 'pulsate') in material-ui ...
I tried removing each prop in button and checked whether it is working or not. I found, button works without autoFocus prop.
Read more >Cannot read properties of null (reading 'pulsate') in material-ui ...
Coding example for the question Cannot read properties of null (reading 'pulsate') in material-ui Button component-Reactjs.
Read more >cannot read properties of null (reading '0') react - You.com
With react useRef, the first time the component renders it'll be equal to null. It gets a value assigned only once that element...
Read more >Troubleshooting - Material UI - MUI
TypeError : Cannot read properties of undefined (reading 'pxToRem'). This error results from trying to access an empty theme. Make sure that you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I have seen 2 issues with your reproduction. 1. It’s using an invalid a > button HTML structure. 2. It’s not using v4.3.0.
We had this issue come up in unit tests
"@material-ui/core": "^4.12.1"(couldn’t automigrate and a lot of stuff needs to be manually checked before we switch to 5)fireEventon a button started to trigger thispulsateerrorReading
@testing-librarydocumentation it suggested:Switching to
@testing-library/user-eventanduser.click(button)(vsfireEvent.click(button)) fixed our tests