Skip to content

Commit f8ee55c

Browse files
author
OpenClaw Bot
committed
fix: add undefined initial value to useRef for React 19 compatibility
- React 19 requires useRef to be called with an initial value - Fixes TS2554: Expected 1 arguments, but got 0
1 parent b30ba4d commit f8ee55c

File tree

1 file changed

+1
-1
lines changed
  • packages/miniapp-runtime/src/app

1 file changed

+1
-1
lines changed

packages/miniapp-runtime/src/app/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const createIceMiniappHook = (lifecycle: keyof PageLifeCycle | string) => {
1313
return (fn: Func) => {
1414
const { R: React, PageContext } = reactMeta;
1515
const id = React.useContext(PageContext) || HOOKS_APP_ID;
16-
const instRef = React.useRef<Instance<PageProps>>();
16+
const instRef = React.useRef<Instance<PageProps> | undefined>(undefined);
1717

1818
// hold fn ref and keep up to date
1919
const fnRef = React.useRef(fn);

0 commit comments

Comments
 (0)