September 2018
Beginner
156 pages
3h 28m
English
For the purpose of this example, let's add material-UI, which includes a custom dialog box component:
npm install --save @material-ui/coreLet's create a custom dialog box that wraps the Dialog component in @material-ui/core:
import { Button, Dialog, DialogActions, DialogContent, DialogTitle } from '@material-ui/core';export class ConfirmationDialog extends Component { render() { const { message, handleClose, isOpen } = this.props; return ( <Dialog open={isOpen}> <DialogTitle>Custom Prompt</DialogTitle> <DialogContent>{message}</DialogContent> <DialogActions> <Button onClick={handleClose.bind(this, true)}> OK </Button> <Button onClick={handleClose.bind(this, false)}> CANCEL ...
Read now
Unlock full access