fix(react): useIonModal/useIonPopover dismiss accepts data and role (#25209)

Resolves #25208
This commit is contained in:
Sean Perkins
2022-04-29 11:57:41 -04:00
committed by GitHub
parent b4ba70ea14
commit 68b2f8bfe1
4 changed files with 30 additions and 8 deletions

View File

@ -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;
}, []);