question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Snackbar is not working. Cannot set property 'transition' of undefined

See original GitHub issue

Rendering 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 🕹

  1. Install the latest material-ui/core.
  2. Put a snackbar in your app and set open={true} so that it renders.
  3. 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:closed
  • Created 3 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
eps1loncommented, Aug 12, 2020
1reaction
eps1loncommented, May 25, 2020

Unless we force an element that can forward the ref #21089 (comment), I don’t see how we could implement it, idea?

If we try to use a method on the node we check first if it’s defined.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found