diff --git a/.changeset/eight-steaks-shout.md b/.changeset/eight-steaks-shout.md new file mode 100644 index 0000000000..62dbebafaf --- /dev/null +++ b/.changeset/eight-steaks-shout.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: correct update_block index type diff --git a/packages/svelte/src/internal/client/render.js b/packages/svelte/src/internal/client/render.js index 045d3b5bf8..5c1ce1181d 100644 --- a/packages/svelte/src/internal/client/render.js +++ b/packages/svelte/src/internal/client/render.js @@ -2078,7 +2078,7 @@ function get_first_element(block) { /** * @param {import('./types.js').EachItemBlock} block * @param {any} item - * @param {import('./types.js').MaybeSignal} index + * @param {number} index * @param {number} type * @returns {void} */ @@ -2093,7 +2093,6 @@ export function update_each_item_block(block, item, index, type) { let prev_index = block.index; if (index_is_reactive) { prev_index = /** @type {import('./types.js').Signal} */ (prev_index).value; - index = /** @type {import('./types.js').Signal} */ (index).value; } const items = block.parent.items; if (prev_index !== index && /** @type {number} */ (index) < items.length) {