Performance: Textarea bindings
MEDIUM IMPACT
This affects input responsiveness and rendering speed when syncing textarea content with application state.
<textarea on:input={e => text = e.target.value}></textarea>
<script>
let text = '';
// Update state only on input event without reactive logging
</script><textarea bind:value={text}></textarea>
<script>
let text = '';
$: console.log(text); // runs on every keystroke
</script>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Direct bind:value with reactive statements | High (updates every keystroke) | 1 per keystroke | Medium | [X] Bad |
| Input event handler without reactive logging | Moderate (updates on input) | 1 per input | Low | [OK] Good |