Skip to content

Instantly share code, notes, and snippets.

View Shaunmak1214's full-sized avatar
🏠
Working from home

Shaun Mak Shaunmak1214

🏠
Working from home
View GitHub Profile
@Shaunmak1214
Shaunmak1214 / AlertDialogWrapper.tsx
Last active September 4, 2022 05:06
An alert dialog wrapper that support asynchronous handling of confirmations. Providing a function-like type approach to instantiate your alert dialog
import React, { useRef } from 'react';
import {
AlertDialog,
AlertDialogBody,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogContent,
AlertDialogOverlay,
AlertDialogCloseButton,