[docs] [standalone lit-html] calling render on a subtree is not recommended
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 142
- Forks
- 230
- PR merge metrics
- No merged PRs in 30d
Description
Expand https://lit.dev/docs/libraries/standalone-templates/ to document that calling `render` on an element that is part of a lit managed subtree is not recommended.
Came up in discussion of https://github.com/lit/lit/issues/2189
Repro, what is the final rendered DOM?
```js
import {html, render} from 'lit';
const ui = (v1, v2) => html`
render(ui('one', 'two'), document.body);
render(html`
Some
more
DOM
`,document.querySelector('#binding-1')!);
render(ui('three', 'four'), document.body);
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the standalone templates page at lit.dev/docs/libraries/standalone-templates/ and run the supplied render example to inspect its final DOM. Update that documentation to explain why rendering into an element within a Lit-managed subtree is not recommended, including the behavior shown by the repro.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100