-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perf.printWasted() doesn't work when component conditionally returns null #6885
Comments
I believe this is a duplicate of #6871. If you can reproduce this with the development build, please provide a minimal project showing it. |
Oh, on a second read, I now realize it’s a different problem. |
This looks weird. Can you try to produce a minimal reproducing case? |
In particular, where do you run |
I call it from the console. When I run I did a small test and removed all my
and I will try to prepare some code to reproduce it. In previous version |
Please do!
It was completely rewritten in 15.1.0 for a number of reasons. Some issues are expected, as the rough edges get fixed. Thanks for helping make it better. |
I've discovered that issue occurs only when you use material-ui Dialog component on the other execution path, something like that
Here is the link to the code of Dialog component: https://github.com/callemall/material-ui/blob/master/src/Dialog/Dialog.js On monday I will prepare full demo (they don't have a cdn version of material so I cannot make a quick demo on jsfiddle) |
Thank you! |
Here is the repository with code: https://github.com/niba/react_perf_material_bug I've noticed a little difference between latest version and 15.0.1. In 15.1.0 I'm able to use printWasted (I see table with results) despite the errors in logs. |
Hey, https://github.com/facebook/react/issues/6885#issuecomment-221863992 Thank you. |
After upgrading to React 15.0.1 or 15.1.0 I'm not able to use printWasted from Perf tools.
React 15.0.1 throws error:
ReactDefaultPerfAnalysis.js:177 Uncaught TypeError: Cannot read property 'forEach' of undefined(…)
React 15.1.0
warning.js:44 Warning: There is an internal error in the React performance measurement code. We did not expect componentDidMount timer to stop while no timer is still in progress for another instance. Please report this as a bug in React
I discovered that error is connected with returning
null
. A lot of my components have something like thatAnd when I try to measure one of those components I will get above error. Removing conditions from components fixes problem.
The text was updated successfully, but these errors were encountered: