Dialogs can come in handy when you need to collect input from the user, but you don't want to lose the current screen. For example, the user is looking at a screen that shows a list of items and wants to create a new item. A dialog could display the necessary form fields and, once the new item is created, the dialog closes and the user is right back at their item list.
Collecting form input
How to do it...
Let's say that your application allows for the creation of new users. For example, from the screen that shows a list of users, the user clicks on a button that shows a dialog containing the fields for creating a new user. Here's an example of how to do this:
import React, { Fragment, useState } from &apos...