4 ms·
This is way too much magic, starting to look like Vue or Svelte
by qn9n 1y ago
This is way too much magic, starting to look like Vue or Svelte
- zdragnar 1y agoThat's because lit templates are in template strings, so passing through a function requires the dollar sign and curly braces (that's just vanilla js). Everything else about it in the example, aside from using @click instead of onclick, is identical to react.
- mock-possum 1y agoYeah even @event is just a shortcut - you can just use this.shadowRoot.addEventListener(‘click’, this.onClickHandler) if you prefer.