fix(angular, react, vue): overlays no longer throw errors when used inside tests (#24681)

resolves #24549, resolves #24590
This commit is contained in:
Liam DeBeasi
2022-02-02 15:25:51 -05:00
committed by GitHub
parent b0c9f097d2
commit 897ae4a454
12 changed files with 94 additions and 74 deletions

View File

@ -1,4 +1,5 @@
import { AlertButton, AlertOptions, alertController } from '@ionic/core/components';
import { defineCustomElement } from '@ionic/core/components/ion-alert.js';
import { useCallback } from 'react';
import { HookOverlayOptions } from './HookOverlayOptions';
@ -9,7 +10,7 @@ import { useController } from './useController';
* @returns Returns the present and dismiss methods in an array
*/
export function useIonAlert(): UseIonAlertResult {
const controller = useController<AlertOptions, HTMLIonAlertElement>('IonAlert', alertController);
const controller = useController<AlertOptions, HTMLIonAlertElement>('IonAlert', alertController, defineCustomElement);
const present = useCallback(
(messageOrOptions: string | (AlertOptions & HookOverlayOptions), buttons?: AlertButton[]) => {