March 2019
Intermediate to advanced
534 pages
14h 52m
English
When users create new resources in your application, you probably want to let them know when the resource is created successfully. Snackbars are a good tool for this because they don't force the user away from anything that they might be in the middle of. What would be nice is if you included an action button in the snackbar that linked to the newly created resource.
Let's modify this example so that, when the user clicks on the CREATE button, they'll see a snackbar with the following:
Let's add routes from react-router-dom and then add the link to the snackbar. Here's the new markup:
<Fragment> <Route exact path="/" render={() => ( <Button onClick={() => setOpen(true)}>create ...Read now
Unlock full access