Skip to content

Commit 04540b3

Browse files
committed
Merge branch 'master' into v2.0-integration
2 parents 9bc006a + 3bb0e1b commit 04540b3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/toolkit/src/immutableStateInvariantMiddleware.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ function trackProperties(
5656
isImmutable: IsImmutableFunc,
5757
ignorePaths: IgnorePaths = [],
5858
obj: Record<string, any>,
59-
path: string = ''
59+
path: string = '',
60+
checkedObjects: Set<Record<string, any>> = new Set()
6061
) {
6162
const tracked: Partial<TrackedProperty> = { value: obj }
6263

63-
if (!isImmutable(obj)) {
64+
if (!isImmutable(obj) && !checkedObjects.has(obj)) {
65+
checkedObjects.add(obj);
6466
tracked.children = {}
6567

6668
for (const key in obj) {

0 commit comments

Comments
 (0)