REACT- MUI - Dialog Box - Sample for confirmation of Delete Record. - Send Response value from Child Component to Parent
REACT- MUI - Dialog Box - Sample for confirmation of Delete Record. Sample code also demonstrate how to send value from child component to parent component // This method will be triggered on response from dialog box const ConfirmBoxHandleResponse = (ResponseValue) => { if (ResponseValue === true) { DeleteData(); } }; // State variable to handle visibility of Dialog box const [ShowConfirmationValue, SetShowConfirmationValue] = useState(false); const ShowConfirmation = () => { SetShowConfirmationValue(true); }; // Button to trigger dialog box – for delete <Button variant="outlined" startIcon={<DeleteIcon />} ...