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
fragerdazOP2y ago
Is that different from listening to DOMContentLoaded inside components? (like the row component you mention)
lxsmnsyc
lxsmnsyc2y ago
DOMContentLoaded refers to the entire page. It's not an element-specific event.
Want results from more Discord servers?
Add your server