From e0b8753d4abf1d850f2a6e3e021a99d077adb320 Mon Sep 17 00:00:00 2001 From: Tali Auster Date: Mon, 20 Jan 2025 17:46:29 -0800 Subject: [PATCH] fix: log warning when cloning state skips a value --- utils/clone_state.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/clone_state.ts b/utils/clone_state.ts index 8126094..b7df9f2 100644 --- a/utils/clone_state.ts +++ b/utils/clone_state.ts @@ -9,6 +9,9 @@ export function cloneState>(state: S): S { const clonedValue = structuredClone(value); clone[key as keyof S] = clonedValue; } catch { + console.warn( + `Cannot clone value for: ${key}. Modify contextState to change this behavior.`, + ); // we just no-op values that cannot be cloned } }