Skip to content

Commit

Permalink
fix(react): fix to regression in overlay hooks dimiss method (#24038)
Browse files Browse the repository at this point in the history
resolves #24030
  • Loading branch information
elylucas committed Oct 7, 2021
1 parent 11332e4 commit 655631d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/react/src/hooks/useController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,10 @@ export function useController<OptionsType, OverlayType extends OverlayBase>(
[controller]
);

const dismiss = useCallback(
() => async () => {
overlayRef.current && (await overlayRef.current.dismiss());
overlayRef.current = undefined;
},
[]
);
const dismiss = useCallback(async () => {
overlayRef.current && (await overlayRef.current.dismiss());
overlayRef.current = undefined;
}, []);

return {
present,
Expand Down

0 comments on commit 655631d

Please sign in to comment.