News for hackers. Stuff that matters.
Re:Why I don't miss React: a story about using the platform by semiquaver on Tuesday May 03, 2022 @09:41PM (#31255850)
Yes, they are usable without polyfills in any modern browser. The general idea is that you can register new element types whose behavior is defined in JavaScript classes. They interact with the rest of the DOM in the same way other HTML elements do: by emitting and handling events.

They can also maintain a “shadow DOM” with its own HTML subtree and CSS scope, so that you can make complex elements whose internal state is encapsulated from the rest of the DOM.

Re:Why I don't miss React: a story about using the platform by protocontrol on Wednesday May 04, 2022 @02:36AM (#31257419)
Hi. Sorry I couldn't parse that without a specific example. In which typical use cases should I create new element types?
Re:Why I don't miss React: a story about using the platform by mhoad on Wednesday May 04, 2022 @07:34AM (#31259086)
This might be a good introduction from the Lit team themselves to see what this looks like in practice https://youtu.be/QBa1_QQnRcs
Re:Why I don't miss React: a story about using the platform by cube00 on Wednesday May 04, 2022 @07:25AM (#31259015)
Whenever you'd usually create a new component in React.