mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 02:31:34 +08:00
fix(react): useIonModal/useIonPopover dismiss accepts data and role (#25209)
Resolves #25208
This commit is contained in:
@ -40,5 +40,5 @@ export type UseIonModalResult = [
|
||||
/**
|
||||
* Dismisses the modal
|
||||
*/
|
||||
() => void
|
||||
(data?: any, role?: string) => void
|
||||
];
|
||||
|
@ -81,8 +81,8 @@ export function useOverlay<OptionsType, OverlayType extends OverlayBase>(
|
||||
}
|
||||
}, []);
|
||||
|
||||
const dismiss = useCallback(async () => {
|
||||
overlayRef.current && (await overlayRef.current.dismiss());
|
||||
const dismiss = useCallback(async (data?: any, role?: string) => {
|
||||
overlayRef.current && (await overlayRef.current.dismiss(data, role));
|
||||
overlayRef.current = undefined;
|
||||
containerElRef.current = undefined;
|
||||
}, []);
|
||||
|
Reference in New Issue
Block a user