Video details

keyed each block

Svelte
04.11.2021
English

Let's have a deeper discussion about the {#each} block. How does Svelte updates the element or component when the array in the {#each} block changed?
By default, when you add / remove / modify the array in the {#each}, it will add / remove items from the end of the list. You can change that with a keyed {#each} block.
---
đź’»
REPL https://svelte.dev/repl/38f0777212af4a07813f5c3a3a3f0109?version=3.37.0
đź“š
Related Resources Svelte https://svelte.dev Svelte REPL https://svelte.dev/repl Svelte Tutorial: Keyed Each blocks https://svelte.dev/tutorial/keyed-each-blocks
🥰 Support me https://www.buymeacoffee.com/lihautan
đź”—
Want to learn more from me? Check out these links:
Twitter: https://twitter.com/lihautan Blog: https://lihautan.com/ Newsletter: https://lihautan.com/newsletter
#svelte #svelte101
Thanks for watching 🥰 -- with love, Li Hau