I have migrated MUI-4 to MUI-5 and facing this error. Any Help?
I discovered that I was feeding my own component inside the SnackBar. When I wrapped the content of SnackBar in a div, it was fixed. As the error message says "Expected an element that can hold a ref," SnackBar's child needs to be an element that can hold a ref, e.g. a div.
Before:
<SnackBar> <MyAlert/> </SnackBar>
After: <SnackBar><div> <MyAlert/> </div> </SnackBar>
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With