The on:submit|preventDefault syntax is optional. We could use the regular event.preventDefault(); call in the handleSubmit() function to keep the HTML cleaner.
In case of the htmlFor, thanks for pointing that out. I copied the initial source code from the React website to make sure I don't miss any feature in the Svelte version. I've updated the blog post and the interactive demo to use for.
Hi Avon,
Thanks for your feedback.
The
on:submit|preventDefault
syntax is optional. We could use the regularevent.preventDefault();
call in thehandleSubmit()
function to keep the HTML cleaner.In case of the
htmlFor
, thanks for pointing that out. I copied the initial source code from the React website to make sure I don't miss any feature in the Svelte version. I've updated the blog post and the interactive demo to usefor
.Good to know; appreciate you clarifying!