question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: react-devtools profiler doesn't show props

See original GitHub issue

According to docs, it’s possible to see props and state of a component at each commit. https://reactjs.org/blog/2018/09/10/introducing-the-react-profiler.html#browsing-commits

Yet, in every project I’ve tried all I see is the names of changed props, but not their values, like the gif from docs claims.

React version: 16.12.0 extension: 4.4.0 (1/3/2020) … Created from revision f749045a5 on 1/3/2020

Steps To Reproduce

  1. create counter app with CRA or another method
  2. open profiler and change state
  3. observe how only the name of the prop is visible, but not its value
function App() {
  let [a, setA] = useState(0);

  return (
    <div className="App">
      <button onClick={() => setA(v => v + 1)}>inc</button>
      <Kid a={a} />
    </div>
  );
}

function Kid() {
  return null;
}

The current behavior

current behavior

The expected behavior

expected behavior

Am I doing something wrong or has this feature been removed? I know you can see props in the inspector, but there it’s only the most recent ones.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
bvaughncommented, Feb 3, 2020

The blog post you linked to was for a previous version of DevTools. That version created immutable copies of all props and state values (using immutable) which allowed the Profiler UI to show past values. However this came with the cost of introducing a lot of overhead for large apps.

Last year, I rewrote DevTools primarily to make it a lot faster (and also to add some new features that would have been difficult to build on the old one). You can read more about that rewrite here if you’re interested: https://reactjs.org/blog/2019/08/15/new-react-devtools.html

The relevant change here is that we no longer do the immutable clone, so the Profiler UI cannot show previous values. It can still tell you which props or state changed though- but it will only show their names. This is by design, as a performance trade off.

Sorry for the confusion.

1reaction
AlexOxorncommented, Mar 10, 2020

Couldn’t this be a toggle-able option? I get that changing the default behavior, but what if someone needed the old behavior. Sometimes knowing which prop changed is of little help if I can’t figure out how it changed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why react dev tools Profiler dont show me component props?
It lacks displaying names of custom Hooks. It does show prop names but only the ones that changed and doesn't show their values....
Read more >
Why react dev tools Profiler dont show me component props?
The Props changed in the Profiler is still there, however it's not as detailed. It lacks displaying names of custom Hooks. It does...
Read more >
Introducing the React Profiler – React Blog
DevTools will show a “Profiler” tab for applications that support the new profiling ... Viewing a component's props and state for a commit....
Read more >
react developer tools does not showing components - You.com
If you don't see your component when searching by its name, then it means it is currently not being rendered. You need to...
Read more >
A guide to features and updates in React DevTools
In September 2018, the React team introduced an incredibly powerful feature for debugging performance-related issues called the React Profiler.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found