State not updating in realtime

rohan7chaudhary
创建于
2019-09-25 12:32:56

I am updating state in setState() and the page is rendered correctly, but "React Developer Tools" is showing previous state.
Objects and Arrays are updating in realtime but not "boolean / string / number values".
But when I close the dev tools window ( not switching tabs ) and reopen it, then only it shows the updated state.
I don't remember if this was the issue from prev version, but please add realtime state update functionality to it.

7条回答
yasuf
回复于
2019-09-25 18:48:56
#1

do you have an example of the issue?

rohan7chaudhary
回复于
2019-09-25 19:33:31
#2

Hi Yasuf, I have made a video of the issue, hope it will help you in understanding the issue better.
https://drive.google.com/file/d/1kMxzZUfuoQZfEgq1JNrK0pg3VJM3NSPb/view

dominiceden
回复于
2019-09-25 20:02:17
#3

I'm also experiencing this exact same issue as in @rohan7chaudhary's video above. Chrome Version 77.0.3865.90 (Official Build) (64-bit), Mac OS X 10.14.6 (18G95), React Developer Tools 4.1.0 (updated 19th September 2019), React version 16.9.0.

The state (as seen in the React DevTools) does not update when the DevTools are open, but closing the Chrome Developer Tools and reopening the React DevTools to inspect the state shows that the state has changed. It feels like I've accidentally turned on some kind of setting to 'freeze' the state but only in React DevTools?

bvaughn
回复于
2019-09-25 20:42:35
#4

Duplicate of #16843

Fix will be going out sometime this afternoon, probably. Sorry for the inconvenience.

dominiceden
回复于
2019-09-26 06:20:48
#5

Ah thanks @bvaughn, I didn't see that duplicate issue. Thanks for all your great work, DevTools is a lifesaver.

mcgee87
回复于
2019-11-25 07:49:25
#6

@bvaughn Did you ever resolve the issue regarding state not reflecting updates with React DevTools ?

dominiceden
回复于
2019-11-29 13:48:19
#7

Hi @mcgee87 an update should have been released a while ago - if it's still happening to you, have you tried uninstalling DevTools and reinstalling to ensure you pick up the latest version? Chrome's extension updating mechanism isn't that obvious unfortunately - AFAIK it likes to just update silently in the background.

当前位于第1页,总计7 条回复

推荐相似问题

Problem with updating component state in the "Components" tab of React Developer Tools - Chrome extension

Hello everyone, I have a problem with Chrome extension - React Developer Tools, if I change component's state it's not c
讨论数 2
react
创建时间:2019-09-25 12:13:45

React dev tools doesn't appear in chrome (Ubuntu 18.04.3)

Do you want to request a feature or report a bug? Report a bug What is the current behavior? React dev tools don't appea
讨论数 4
react
创建时间:2019-09-25 10:40:39

Hook params inside functions are not updated (only for event listeners)

Do you want to request a feature or report a bug? Bug(possibly) What is the current behavior? Whenever a function is cal
讨论数 3
react
创建时间:2019-09-25 09:03:18

Error: Invalid operand to 'in': Object expected ==> IE10

Getting "Invalid operand to 'in': Object expected" error, in react application, I haven't used 'in' operator throughout
讨论数 5
react
创建时间:2019-09-25 08:40:21

Wrong DOM calculations between renders in Firefox

Do you want to request a feature or report a bug? bug What is the current behavior? Using useCallback through a custom h
讨论数 6
react
创建时间:2019-09-25 07:26:47

unable to toggle true/false in state variables in new version of react dev tools

Do you want to request a feature or report a bug? What is the current behavior? If the current behavior is a bug, please
讨论数 2
react
创建时间:2019-09-25 05:57:55

[eslint-plugin-react-hooks] allow configuring custom hooks as "static"

Do you want to request a feature or report a bug? Feature/enhancement What is the current behavior? Currently the eslint
讨论数 12
react
创建时间:2019-09-24 11:45:13