From a7e94503fe07ae984decbbc5cfaba258c5aa7a52 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 23 Jul 2024 08:29:35 +0200 Subject: [PATCH] Export usePopoverShouldClose from entry point --- src/hooks/test/use-popover-should-close-test.js | 2 +- src/hooks/use-popover-should-close.ts | 2 +- src/index.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/test/use-popover-should-close-test.js b/src/hooks/test/use-popover-should-close-test.js index 8a094147b..fabe1c85d 100644 --- a/src/hooks/test/use-popover-should-close-test.js +++ b/src/hooks/test/use-popover-should-close-test.js @@ -1,7 +1,7 @@ import { mount } from 'enzyme'; import { useRef } from 'preact/hooks'; -import usePopoverShouldClose, { $imports } from '../use-popover-should-close'; +import { usePopoverShouldClose, $imports } from '../use-popover-should-close'; describe('usePopoverShouldClose', () => { function FakeComponent({ closeHandler, options }) { diff --git a/src/hooks/use-popover-should-close.ts b/src/hooks/use-popover-should-close.ts index b188574be..9c59418fc 100644 --- a/src/hooks/use-popover-should-close.ts +++ b/src/hooks/use-popover-should-close.ts @@ -20,7 +20,7 @@ export type UsePopoverShouldCloseOptions = { * @param handleClose - Callback invoked to close the popover * @param options */ -export default function usePopoverShouldClose( +export function usePopoverShouldClose( popoverEl: RefObject, handleClose: () => void, options: UsePopoverShouldCloseOptions = {}, diff --git a/src/index.ts b/src/index.ts index 889a00b8a..e3bc199be 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,6 +4,7 @@ export { useClickAway } from './hooks/use-click-away'; export { useFocusAway } from './hooks/use-focus-away'; export { useKeyPress } from './hooks/use-key-press'; export { useOrderedRows } from './hooks/use-ordered-rows'; +export { usePopoverShouldClose } from './hooks/use-popover-should-close'; export { useStableCallback } from './hooks/use-stable-callback'; export { useSyncedRef } from './hooks/use-synced-ref'; export { useToastMessages } from './hooks/use-toast-messages';