Future King
Future King

Reputation: 3849

Chrome Developer Tools showing different values of JSON object

See the screenshot. https://i.sstatic.net/dsh2T.png

I am logging JSON data in my react application. But chrome dev is showing token value but when expanded it shows null. Why? And my application is also getting null value.

Upvotes: 1

Views: 1003

Answers (1)

kmui2
kmui2

Reputation: 2517

But chrome dev is showing token value but when expanded it shows null. Why?

When you expand it, Chrome re-evaluates the object again to show all properties (not at the time you log it). So it is likely that your data got mutated between the time you logged the value and expanded it in the console.

You should see a small info icon next to it telling you it got re-evaluated. Reference: https://dev.to/buddylreno/expanding-objects-in-chrome-dev-tools-happens-asynchronously-3p3j

Upvotes: 2

Related Questions