From 5e03da058b2d2c3b0d153b8d2bad9c6be630abe3 Mon Sep 17 00:00:00 2001 From: David Bismut Date: Tue, 17 Jan 2023 22:00:23 +0100 Subject: [PATCH] fix: fix regression --- packages/leva/package.json | 2 +- packages/leva/src/useControls.ts | 6 ++++-- pnpm-lock.yaml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/leva/package.json b/packages/leva/package.json index c68ad3ec..95405e71 100644 --- a/packages/leva/package.json +++ b/packages/leva/package.json @@ -32,6 +32,6 @@ "react-colorful": "^5.6.1", "react-dropzone": "^14.2.3", "v8n": "^1.5.1", - "zustand": "^4.1.4" + "zustand": "^4.3.2" } } diff --git a/packages/leva/src/useControls.ts b/packages/leva/src/useControls.ts index e0203dde..3a2744f4 100644 --- a/packages/leva/src/useControls.ts +++ b/packages/leva/src/useControls.ts @@ -208,10 +208,12 @@ export function useControls | string, (s) => { const input = s.data[path] // @ts-ignore - const value = input.disabled ? undefined : input.stateValue + const value = input.disabled ? undefined : input.value return [value, input] }, - ([value, input]: any) => onChange(value, path, { initial: false, get: store.get, ...input }), + ([value, input]: any) => { + onChange(value, path, { initial: false, get: store.get, ...input }) + }, { equalityFn: shallow } ) unsubscriptions.push(unsub) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d637950f..60f0a80b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -140,7 +140,7 @@ importers: react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dropzone: ^14.2.3 v8n: ^1.5.1 - zustand: ^4.1.4 + zustand: ^4.3.2 dependencies: '@radix-ui/react-portal': 1.0.1_biqbaboplfbrettd7655fr4n2y '@radix-ui/react-tooltip': 1.0.3_biqbaboplfbrettd7655fr4n2y