preactjs / preactjs/preact-devtools

When compoonent overwrites the state then the state which is rendered does not match the state I see in devtools

Open
#319 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
345
Forks
39
PR merge metrics
No merged PRs in 30d

Description

When I change the state in the devtools but the component has getDerivedStateFromProps which overwrites it, then the state which is rendered does not match the state I see in devtools. This is confusing.
It would be best if devtoools could refresh the component state after the component rendered.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Reproduce the mismatch in the Preact devtools by editing a component's state when it uses getDerivedStateFromProps, then compare the rendered state with the state shown in devtools. Trace the refresh timing around component rendering; done means the displayed state matches the state after the component has rendered.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.