Skip to content

Commit

Permalink
fix self-loop bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikaoto committed Jul 15, 2023
1 parent de4e989 commit fc15bb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/state/createState.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit fc15bb5

Please sign in to comment.