onMount() vs addEventListener('DOMContentLoaded')

Is there a best practice (and why) or differences/pros/cons of either means of listening for the DOM to be loaded?
2 Replies
fragerdaz
fragerdaz16mo ago
Is that different from listening to DOMContentLoaded inside components? (like the row component you mention)
lxsmnsyc
lxsmnsyc16mo ago
DOMContentLoaded refers to the entire page. It's not an element-specific event.
Want results from more Discord servers?
Add your server