mirror of https://github.com/sveltejs/svelte
In the first example, "item" is used to describe three logically distinct objects: (1) the name of the slot's property; (2) the JS variable used within FancyList.svelte's {#each} block; and (3) the JS variable used within App.svelte. To make it clearer that these are three different objects, give them different names. The second example can continue reusing the same name for all of the objects to demonstrate there's no collision between them. But we can also simplify the example to take further advantage of shorthand rules.pull/4125/head
parent
a9065d4120
commit
4c630e4ffc
Loading…
Reference in new issue