mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
fix(angular, react, vue): overlays no longer throw errors when used inside tests (#24681)
resolves #24549, resolves #24590
This commit is contained in:
@ -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[]) => {
|
||||
|
Reference in New Issue
Block a user