title: Svelte, on:click event inside each block triggers on page load
body: <p>The problem is that in svelte on:click triggers on page load for some reason. Can anybody explain to me why it's happening and how to prevent it so it only triggers when you actually check the box. This only happens if on:click is inside each block.</p>
  
  <pre><code>&lt;script&gt;
      function handleClick(number) {
          alert(number)
      }
      let numbers = [1,2,3,4,5,6]
  &lt;/script&gt;
  {#each numbers as number}
      &lt;input type=checkbox on:click={handleClick(number)}&gt;
  {/each}
  </code></pre>
  
  <p>You can look at it <a href="https://svelte.dev/repl/19996a3bb68a4f9d845cc183f8f50d94?version=3.23.2" rel="noreferrer">here</a></p>