Skip to content

Commit

Permalink
Fix for react 19 type
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed Dec 6, 2024
1 parent 3078fb2 commit bae8253
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/react/useStatic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { refKey } from "./utils";
* @internal
*/
export const useStatic = <T>(init: () => T): T => {
const ref = useRef<T>();
const ref = useRef<T>(undefined);

Check failure on line 8 in src/react/useStatic.ts

View workflow job for this annotation

GitHub Actions / check

No overload matches this call.
return ref[refKey] || (ref[refKey] = init());
};

0 comments on commit bae8253

Please sign in to comment.