Show Codeconst Example = () => {const [isOpen, setIsOpen] = React.useState(false);const onClose = () => setIsOpen(false);const cancelRef = React.useRef(null);return <Center><Button shadow={2} colorScheme="danger" onPress={() => setIsOpen(!isOpen)}>Delete Customer</Button><AlertDialog leastDestructiveRef={cancelRef} isOpen={isOpen} onClose={onClose}><AlertDialog.Content><AlertDialog.CloseButton /><AlertDialog.Header>Delete Customer</AlertDialog.Header><AlertDialog.Body>This will remove all data relating to Alex. This action cannot bereversed. Deleted data can not be recovered.</AlertDialog.Body><AlertDialog.Footer><Button.Group space={2}><Button variant="unstyled" colorScheme="coolGray" onPress={onClose} ref={cancelRef}>Cancel</Button><Button colorScheme="danger" onPress={onClose}>Delete</Button></Button.Group></AlertDialog.Footer></AlertDialog.Content></AlertDialog></Center>;};
Copyimport { AlertDialog } from "native-base";
Playgroundconst Example = () => {const [isOpen, setIsOpen] = React.useState(false);const onClose = () => setIsOpen(false);const cancelRef = React.useRef(null);return <Center><Button colorScheme="danger" onPress={() => setIsOpen(!isOpen)}>Delete Customer</Button><AlertDialog leastDestructiveRef={cancelRef} isOpen={isOpen} onClose={onClose}><AlertDialog.Content><AlertDialog.CloseButton /><AlertDialog.Header>Delete Customer</AlertDialog.Header><AlertDialog.Body>This will remove all data relating to Alex. This action cannot bereversed. Deleted data can not be recovered.</AlertDialog.Body><AlertDialog.Footer><Button.Group space={2}><Button variant="unstyled" colorScheme="coolGray" onPress={onClose} ref={cancelRef}>Cancel</Button><Button colorScheme="danger" onPress={onClose}>Delete</Button></Button.Group></AlertDialog.Footer></AlertDialog.Content></AlertDialog></Center>;};