mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] reactivity: only call clearReactivesForCallback once on unmount
This commit is contained in:
committed by
Géry Debongnie
parent
99740f9993
commit
922dab8e8f
+1
-1
@@ -233,9 +233,9 @@ export function useState<T extends object>(state: T): Reactive<T> {
|
||||
node,
|
||||
batched(() => node.render())
|
||||
);
|
||||
onWillUnmount(() => clearReactivesForCallback(render));
|
||||
}
|
||||
const render = batchedRenderFunctions.get(node)!;
|
||||
const reactiveState = reactive(state, render);
|
||||
onWillUnmount(() => clearReactivesForCallback(render));
|
||||
return reactiveState;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user