-
I'm building a web page with lots of long forms. Is it a good idea to use svelte:boundary around each form element so that I can define consts? Or does it come at a cost? For example, instead of:
I could do:
Which seems cleaner and less error prone. (It is not practical for me at this point to convert these form fields to components because there are too many small differences and things to take into account). Would you advise against it for some reason? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I would advise against it because boundaries are for error handling and working with async data. If anything, I would go with |
Beta Was this translation helpful? Give feedback.
I would advise against it because boundaries are for error handling and working with async data.
Even if you do not use them for that, they cause some overhead and could be confusing to anyone reading the code.
If anything, I would go with
{#if true}
, though that will also be unnecessary if #16490 gets implemented.