nuxt / nuxt/devtools

fix: reactivity of useState is not populated properly

Open
#643 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
3.3k
Forks
214
Avg merge
13h 22m
Merged PRs (30d)
18

Description

🐛 The bug

When I change the value in the useState, inside a compsable, the new value is not populated proeprly.

Reproduction process

  1. open devtools -> payload and see test-my-test
  2. click Update button
  3. reload value in the devtools (it's still empty)
🛠️ To reproduce

https://stackblitz.com/~/github.com/kleinpetr/nuxt-playground/tree/devtools-usestate-reactivity

🌈 Expected behavior

I would expect the property is being updated.

ℹ️ Additional context

When you reload the page with closed devtools, then hit the Update button and then open them, the value is there and when you click for example to Add string and reload the value, it works correctly but once you hit the Update button again and then reload value in devtools it's stucked.

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.

Research direction

Start with the linked StackBlitz reproduction and follow the useState update flow while inspecting the devtools payload. Confirm the value after clicking Update and reloading it; done means the property is populated and remains current in devtools.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.