@codecademy/gamut
68.3.068.3.1-alpha.0b3b4f.0
dist/Popover/types.d.ts~
dist/Popover/types.d.tsModified+4−3
Index: package/dist/Popover/types.d.ts
===================================================================
--- package/dist/Popover/types.d.ts
+++ package/dist/Popover/types.d.ts
@@ -1,6 +1,6 @@
import { PatternProps } from '@codecademy/gamut-patterns';
-import { HTMLAttributes } from 'react';
+import { HTMLAttributes, type RefObject } from 'react';
import { PopoverVariants } from './elements';
export type FocusTrapPopoverProps = {
/**
* Called when the Popover requests to be closed,
@@ -89,14 +89,15 @@
*/
isOpen: boolean;
/**
* The target element around which the popover will be positioned.
+ * Only ref objects (e.g. from useRef) are supported at runtime; RefCallback is not.
*/
- targetRef: React.RefObject<Pick<HTMLDivElement, 'getBoundingClientRect' | 'contains'>>;
+ targetRef: RefObject<HTMLElement | null>;
/**
* The PopoverContainer which contents will be rendered into.
*/
- popoverContainerRef?: React.RefObject<HTMLDivElement> | React.RefCallback<HTMLDivElement>;
+ popoverContainerRef?: React.Ref<HTMLDivElement | null>;
/**
* Whether to add width restrictions to Popover.
*/
widthRestricted?: boolean;