useDialog
function useDialog(): DialogContextValue;Hook to show alert and confirm dialogs. Must be used within a DialogHost.
Returns
Section titled “Returns”Example
Section titled “Example”const { alert, confirm } = useDialog();
// Alertawait alert("Something happened!");
// Confirmconst ok = await confirm("Delete this item?", { okText: "Delete", cancelText: "Keep"});