Skip to content

Commit 85a6670

Browse files
authored
Improved wording.
The wording provided initially is confusing, and I believe is mistaken.
1 parent 0dabafd commit 85a6670

File tree

1 file changed

+2
-2
lines changed
  • content/tutorial/01-svelte/04-logic/05-keyed-each-blocks

1 file changed

+2
-2
lines changed

content/tutorial/01-svelte/04-logic/05-keyed-each-blocks/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title: Keyed each blocks
33
---
44

5-
By default, when you modify the value of an `each` block, it will add and remove items at the _end_ of the block, and update any values that have changed. That might not be what you want.
5+
By default, when you modify the value of an `each` block, such as adding or removing items, it will apply such modifications at the _end_ of the block, and then update any values that have changed. That might not be what you want.
66

7-
It's easier to show why than to explain. Click the 'Remove first thing' button a few times, and notice what happens: It removes the first `<Thing>` component, but the _last_ DOM node. Then it updates the `name` value in the remaining DOM nodes, but not the emoji, which in `Thing.svelte` is fixed when the component is created.
7+
It's easier to show why than to explain. Click the 'Remove first thing' button a few times, and notice what happens: It doesn't actually remove the first `<Thing>` component, but rather the _last_ DOM node. Then it updates the `name` value in the remaining DOM nodes, but not the emoji, which in `Thing.svelte` is fixed when the component is created.
88

99
Instead, we'd like to remove only the first `<Thing>` component and its DOM node, and leave the others unaffected.
1010

0 commit comments

Comments
 (0)