Skip to content

Commit d3e69b6

Browse files
fix(overmind): make sure cached derived proxy values are rescoped when returned
1 parent d4c9fe9 commit d3e69b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/node_modules/overmind/src/derived.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ export class Derived {
9898

9999
this.previousProxifier = tree.proxifier
100100

101+
// This value might be a proxy, we need to rescope
102+
// it to the current tree looking
103+
if (this.value && this.value[IS_PROXY]) {
104+
return proxyStateTree.rescope(this.value, tree)
105+
}
106+
101107
return this.value
102108
}
103109
}

0 commit comments

Comments
 (0)