From 7b7c87bfc39045164cc18b8266abb3194cec86cc Mon Sep 17 00:00:00 2001 From: Tom Waddell Date: Wed, 4 Sep 2024 13:15:08 +0100 Subject: [PATCH] Fix for zustand detection of array changes Make a copy of the array to use in applyChangesToArray reduce so that zustand sees changes to array data. --- src/patching.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/patching.ts b/src/patching.ts index 5fb4c98..269b90c 100644 --- a/src/patching.ts +++ b/src/patching.ts @@ -171,7 +171,7 @@ export const patchState = (oldState: any, newState: any): any => return revisedArray; } }, - array + [...array] ); const applyChangesToObject = (