[@lit-labs/signals] signal set() in firstUpdated does not cause a rerender.
Open
@sorvell is already working on this.
Since Mar 27, 2025.
- Dominant language
- TypeScript
- Stars
- 21.8k
- Forks
- 1.1k
- Avg merge
- 18h 25m
- Merged PRs (30d)
- 2
Description
### Which package(s) are affected?
@lit-labs/signals
### Description
signal set() in firstUpdated does not cause a rerender.
### Reproduction
https://stackblitz.com/edit/vitejs-vite-gqki2ufj?file=src%2Fsimple-counter.ts&terminal=dev
### Workaround
But if i wait a tick, it rerenders.
```js
protected firstUpdated(): void {
requestAnimationFrame(() => {
this.#value.set(1);
});
}
```
### Affected versions
@lit-labs/signals v0.1.2
### Browser/OS/Node environment
Browser: Chrome 134.0.6998.167
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.
Assessment
This issue has not been assessed yet.