From bae8253a1a72072479b690cac99f620d0356552c Mon Sep 17 00:00:00 2001 From: inokawa <48897392+inokawa@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:38:29 +0900 Subject: [PATCH] Fix for react 19 type --- src/react/useStatic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/react/useStatic.ts b/src/react/useStatic.ts index c8433918f..fc31113d3 100644 --- a/src/react/useStatic.ts +++ b/src/react/useStatic.ts @@ -5,6 +5,6 @@ import { refKey } from "./utils"; * @internal */ export const useStatic = (init: () => T): T => { - const ref = useRef(); + const ref = useRef(undefined); return ref[refKey] || (ref[refKey] = init()); };