Snackbar is not working. Cannot set property 'transition' of undefined
See original GitHub issueRendering snackbar results in error from Grow.js.
- [x ] The issue is present in the latest release.
- [x ] I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
Rendering open snackbar results in this error.
<Snackbar open>
<React.Fragment>test</React.Fragment>
</Snackbar>
AddReminderForm.tsx:151 Uncaught (in promise) TypeError: Cannot set property 'transition' of undefined
at Grow.js:98
at Object.onEnter (Grow.js:70)
at Transition.performEnter (Transition.js:262)
at Transition.updateStatus (Transition.js:228)
at Transition.componentDidMount (Transition.js:172)
stacktrace continues…
Expected Behavior 🤔
I should get my lovely snackbar to render error-free 😃
Steps to Reproduce 🕹
- Install the latest material-ui/core.
- Put a snackbar in your app and set open={true} so that it renders.
- Observe the crash and error.
https://codesandbox.io/s/elated-gauss-8kq2u
Context 🔦
Just rendering a snackbar. That’s really it.
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.9.14 |
React | ^16.12.0 |
Browser | Chrome 81.0.4044.138 |
TypeScript | ^3.7.5 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Snackbar is not working. Cannot set property 'transition' of ...
Install the latest material-ui/core. Put a snackbar in your app and set open={true} so that it renders. Observe the crash and error. https:// ......
Read more >getting TypeError: Cannot set property 'transition' of undefined ...
It seems there is a known issue with react-transition-group. There are few workarounds posted in the ticket, but most of them didn't work...
Read more >Snackbar API - Material UI - MUI
Name Type Default
action node
anchorOrigin
autoHideDuration number null
Read more >SnackBars managed by the ScaffoldMessenger | Flutter
The new approach calls on the ScaffoldMessenger to show the SnackBar . In this case, the Builder is no longer required to provide...
Read more >Quickstart for testing your react app with react-testing-library
Why is that? Because LoginView uses Snackbars, and Snackbars needs to be wrapped with SnackbarProvider to make it work. In the app, every...
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 FreeTop 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
Top GitHub Comments
Fixed in https://github.com/mui-org/material-ui/pull/21883
If we try to use a method on the node we check first if it’s defined.