diff --git a/src/Popover.tsx b/src/Popover.tsx index 764421c..2594214 100644 --- a/src/Popover.tsx +++ b/src/Popover.tsx @@ -55,7 +55,7 @@ const PopoverInternal = forwardRef( boundaryInset, }); - const childRef = useRef(); + const childRef = useRef(undefined); const [popoverState, setPopoverState] = useState({ align, diff --git a/src/index.d.ts b/src/index.d.ts index 92f4065..f671739 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,3 +1,5 @@ +import type { JSX } from 'react'; + export type Rect = { top: number; left: number; diff --git a/src/useElementRef.ts b/src/useElementRef.ts index 89f7dc9..96e42d9 100644 --- a/src/useElementRef.ts +++ b/src/useElementRef.ts @@ -2,7 +2,7 @@ import { useRef, useState, useLayoutEffect } from 'react'; import { CreateContainerProps, createContainer } from './util'; export const useElementRef = ({ containerClassName, containerStyle }: CreateContainerProps) => { - const ref = useRef(); + const ref = useRef(undefined); const [element] = useState(() => createContainer({ containerStyle, containerClassName: containerClassName }),