mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] component: disallow calling hooks outside of setup
(and constructor) Doing so could cause strange and difficult bugs
This commit is contained in:
committed by
Aaron Bohy
parent
4d68dac24d
commit
bd98d4d0d0
+1
-1
@@ -239,7 +239,7 @@ const batchedRenderFunctions = new WeakMap<ComponentNode, Callback>();
|
||||
* @see reactive
|
||||
*/
|
||||
export function useState<T extends object>(state: T): Reactive<T> | NonReactive<T> {
|
||||
const node = getCurrent()!;
|
||||
const node = getCurrent();
|
||||
if (!batchedRenderFunctions.has(node)) {
|
||||
batchedRenderFunctions.set(
|
||||
node,
|
||||
|
||||
Reference in New Issue
Block a user