Bug: react-devtools profiler doesn't show props
See original GitHub issueAccording 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
- create counter app with CRA or another method
- open profiler and change state
- 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
The 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:
- Created 4 years ago
- Comments:7
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.