From 0183028a1a1aa6ced23f848f2cb49d75f613baf9 Mon Sep 17 00:00:00 2001 From: Kenichi Maruyama <11133876+maruyamaworks@users.noreply.github.com> Date: Tue, 11 Mar 2025 00:53:26 +0900 Subject: [PATCH] update type definitions to support react 19 --- src/Popover.tsx | 2 +- src/index.d.ts | 2 ++ src/useElementRef.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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 }),