lit / lit/lit

[@lit-labs/signals] signal set() in firstUpdated does not cause a rerender.

Open
#4,954 2 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.