Skip to content

Commit 0a2bb2e

Browse files
committed
perf: improve onPropsUpdated performance
1 parent 0f73997 commit 0a2bb2e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/react.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ export function useSetup<State, Props = {}>(
6666
}, [tick])
6767

6868
useEffect(() => {
69-
instance.current?.[LifecycleHooks.PROPS_UPDATED]?.forEach(fn => fn(ReactProps))
69+
nextTick(() => {
70+
instance.current?.[LifecycleHooks.PROPS_UPDATED]?.forEach(fn => fn(ReactProps))
71+
})
7072
}, [ReactProps])
7173

7274
setCurrentInstance(instance.current)

0 commit comments

Comments
 (0)