Skip to content

Commit c9cac3e

Browse files
jeremy-vinetiedgarmueller
authored andcommitted
clone oldData when reducing core.data to avoid state mutation in updater
1 parent 52a0a41 commit c9cac3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/reducers/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export const coreReducer = (
210210
};
211211
} else {
212212
const oldData: any = get(state.data, action.path);
213-
let newData = action.updater(oldData);
213+
let newData = action.updater(cloneDeep(oldData));
214214
if (newData === '') {
215215
newData = undefined;
216216
}

0 commit comments

Comments
 (0)