Skip to content

Commit 60ab963

Browse files
committed
Update [Part 2 / Transitions / Key blocks]
Added reference to the value "i" to explain, that the key block rebuilds when the following expression (after #key) changes, not just "an expression". This should provide more clarity.
1 parent 1386bdb commit 60ab963

File tree

1 file changed

+2
-2
lines changed
  • content/tutorial/02-advanced-svelte/02-transitions/08-key-blocks

1 file changed

+2
-2
lines changed

content/tutorial/02-advanced-svelte/02-transitions/08-key-blocks/README.md

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

5-
Key blocks destroy and recreate their contents when the value of an expression changes. This is useful if you want an element to play its transition whenever a value changes instead of only when the element enters or leaves the DOM.
5+
Key blocks destroy and recreate their contents when the value of the following expression (in the example: `i`) changes. This is useful if you want an element to play its transition whenever a value changes instead of only when the element enters or leaves the DOM.
66

7-
Here, for example, we'd like to play the `typewriter` transition from `transition.js` whenever the loading message changes. Wrap the `<p>` element in a key block:
7+
Here, for example, we'd like to play the `typewriter` transition from `transition.js` whenever the loading message, i.e. `i` changes. Wrap the `<p>` element in a key block:
88

99
```svelte
1010
/// file: App.svelte

0 commit comments

Comments
 (0)