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.

ReactDefaultPerf.printWasted() doesn't work

See original GitHub issue

Calling ReactDefaultPerf.printWasted() results in:

Uncaught TypeError: Cannot read property 'forEach' of undefined
writes.(anonymous function).forEach @ ReactDefaultPerfAnalysis.js:195
Object.keys.forEach @ ReactDefaultPerfAnalysis.js:192
getUnchangedComponents @ ReactDefaultPerfAnalysis.js:191
getInclusiveSummary @ ReactDefaultPerfAnalysis.js:139
ReactDefaultPerf.getMeasurementsSummaryMap @ ReactDefaultPerf.js:118
ReactDefaultPerf.printWasted @ ReactDefaultPerf.js:133

(this is on a page internally at Facebook so I assume it’s a fairly recent React version)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
sverrejohcommented, Apr 10, 2016

Yes. ReactPerf.start(), ReactPerf.stop() and the rest of the Perf API works, for example ReactPerf.printExclusive(), but not ReactPerf.printWasted().

I changed over to my 0.14.7 branch, and there everything works like it should, and I double checked that both ReactPerf and React was on 15.0.1.

image

I can dig around a bit more if this isn’t anything known.

0reactions
gaearoncommented, Apr 14, 2016

Thank you, this is very helpful! I’ll dig into it and see if I can repro this given the new info.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to identify and resolve wasted renders in React
First, we developers should understand how React works. How do the components live through the component lifecycles in the applications lifetime ...
Read more >
how to check wasted renders in component react
I am trying to debug performance issues in a ...
Read more >
Performance Tools - React
The following methods use the measurements returned by Perf.getLastMeasurements() to pretty-print the result. printInclusive(); printExclusive(); printWasted() ...
Read more >
How to Optimize Components to Improve React Performance
In this tutorial, you will learn how to maximize React performance by measuring rendering bottlenecks and optimizing your components.
Read more >
[bug] Problems of using react-addons-perf · Issue #6949 · facebook ...
I'm getting results back from Perf.getWasted(measurements) but I'm seeing this warning crop up too: Warning: There is an internal error in the React...
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