←back to thread

277 points merqurio | 2 comments | | HN request time: 0.4s | source
Show context
jfagnani ◴[] No.45113365[source]
Lit maintainer here. I should be going to bed, but I'll answer any questions if people have any!

Not sure why Lit showed up on the front page tonight :)

replies(11): >>45113424 #>>45113441 #>>45113454 #>>45113460 #>>45113948 #>>45113980 #>>45114324 #>>45115284 #>>45115810 #>>45115985 #>>45117006 #
1. mkleczek ◴[] No.45113980[source]
Thanks for your great work.

I can't find clear information about how re-rendering and stateful third-party components interact.

Let's say I have a stateful data table web component that I use in the template. Is it going to be re-created every time the template is re-rendered (loosing its internal state)?

replies(1): >>45114062 #
2. jfagnani ◴[] No.45114062[source]
Thanks!

Elements are kept stable as long as the template containing them is rendered.

The template docs try to get this across by saying that Lit "re-render only the parts of template that have changed." Maybe that needs more detail.

There are details here: https://github.com/lit/lit/blob/main/dev-docs/design/how-lit...