From 9722588121c57e97ba9097b7ce98d3266cef7012 Mon Sep 17 00:00:00 2001 From: Micheal Parks Date: Mon, 6 Apr 2026 20:59:06 -0400 Subject: [PATCH 1/2] use granular state updates on rerender --- src/lib/props.svelte.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/props.svelte.js b/src/lib/props.svelte.js index 64c94a4..455613e 100644 --- a/src/lib/props.svelte.js +++ b/src/lib/props.svelte.js @@ -10,7 +10,7 @@ * @returns {[Props, (nextProps: Partial) => void]} */ const createProps = (initialProps = {}) => { - let currentProps = $state.raw(initialProps) + let currentProps = $state(initialProps) const props = new Proxy(/** @type {Props} */ (initialProps), { get(_, key) { @@ -30,7 +30,9 @@ const createProps = (initialProps = {}) => { /** @param {Partial} nextProps */ const update = (nextProps) => { - currentProps = { ...currentProps, ...nextProps } + for (const key in nextProps) { + currentProps[key] = nextProps[key] + } } return [props, update] From d5ba463863d460933392c03d565c606f8a677304 Mon Sep 17 00:00:00 2001 From: Micheal Parks Date: Mon, 6 Apr 2026 20:59:30 -0400 Subject: [PATCH 2/2] changeset --- .changeset/yummy-shrimps-deny.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/yummy-shrimps-deny.md diff --git a/.changeset/yummy-shrimps-deny.md b/.changeset/yummy-shrimps-deny.md new file mode 100644 index 0000000..e321f95 --- /dev/null +++ b/.changeset/yummy-shrimps-deny.md @@ -0,0 +1,5 @@ +--- +'@threlte/test': patch +--- + +Use granular state updates on rerender