Error boundaries in React enable you to capture errors that happen when your components attempt to render. You can use the Snackbar components in your error boundaries to display captured errors. Furthermore, you can style snackbars so that errors are visually distinctive from normal messages.
Error boundaries and error snackbars
How to do it...
Let's say that you have an error boundary at the top level of your application and you want to use the Snackbar component to display error messages to users. Here's an example that shows how you can do this:
import React, { Fragment, Component } from 'react';
import { withStyles } from '@material-ui/core/styles';
import Snackbar from '@material-ui/core...