Hacker Newsnew | past | comments | ask | show | jobs | submit | passle's commentslogin

If you've been building complex web components for 4 years, hopefully by now you've realized you can actually pass _properties_ down to custom elements.


Yep, but now you have two ways of doing a thing. With attributes you have attributeChangedCallback, with props you have set prop functions.

Attributes show up nice in dom explorer and make it easy to debug, props don’t.

I could go deep into this, when you bring typescript into the equation for large apps, there are all sorts of tradeoffs to keep in mind.


If people are interested in getting started with web components, lit-html and LitElement, we have a bunch of scaffolding and tooling ready to go at: https://open-wc.org/


open-wc.org is a really great project. Thanks for your work there!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: