From fc15bb537681972f779af19e8a2f412ef07ba50e Mon Sep 17 00:00:00 2001 From: Nika Otiashvili Date: Sun, 16 Jul 2023 00:05:07 +0400 Subject: [PATCH] fix self-loop bug --- packages/state/createState.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/state/createState.js b/packages/state/createState.js index e2b94ad1..88fd7d43 100644 --- a/packages/state/createState.js +++ b/packages/state/createState.js @@ -27,9 +27,10 @@ export const createState = function (element, parent, options) { // NOTE: Only true when 'onlyResolveExtends' option is set to true if (skipApplyMethods) { - if (element.parent && element.parent.state) { + if (element.parent && element.parent.state) element.state.parent = element.parent.state - } else { element.state.parent = element.state } // self loop + else + element.state.parent = {} return element.state }