@@ -243,50 +243,50 @@ window.setInterval(() => {
243
243
ReactDOM . render ( React . createElement ( RenderLogs , { renders : renders } ) , containingElement ) ;
244
244
245
245
export default function createRenderVisualizer ( shouldInstrumentComponent ) {
246
- return function renderVisualizer ( ) {
247
- return function wrapRenderVisualizer ( ReactClass , componentId ) {
248
-
249
- if ( typeof shouldInstrumentComponent === 'function' && ! shouldInstrumentComponent ( ReactClass ) ) {
250
- return ReactClass ;
251
- }
252
-
253
- const old = {
254
- componentDidMount : ReactClass . prototype . componentDidMount ,
255
- componentDidUpdate : ReactClass . prototype . componentDidUpdate ,
256
- componentWillUnmount : ReactClass . prototype . componentWillUnmount
257
- } ;
258
-
259
- ReactClass . prototype . componentDidMount = function ( ) {
260
- renders . set ( this , {
261
- id : window . __reactRendersCount ++ ,
262
- log : [ ] ,
263
- count : 0 ,
264
-
265
- posTop : 0 ,
266
- posLeft : 0
267
- } ) ;
268
- addToRenderLog ( this , 'Initial Render' ) ;
269
-
270
- if ( old . componentDidMount ) {
271
- return old . componentDidMount . apply ( this , [ ...arguments ] ) ;
272
- }
273
- } ;
274
- ReactClass . prototype . componentDidUpdate = function ( prevProps , prevState ) {
275
- addToRenderLog ( this , getReasonForReRender ( prevProps , prevState , this . props , this . state ) ) ;
276
-
277
- if ( old . componentDidUpdate ) {
278
- return old . componentDidUpdate . apply ( this , [ ...arguments ] ) ;
279
- }
280
- } ;
281
- ReactClass . prototype . componentWillUnmount = function ( ) {
282
- renders . delete ( this ) ;
283
-
284
- if ( old . componentWillUnmount ) {
285
- return old . componentWillUnmount . apply ( this , [ ...arguments ] ) ;
286
- }
287
- } ;
288
-
289
- return ReactClass ;
290
- } ;
291
- }
246
+ return function renderVisualizer ( ) {
247
+ return function wrapRenderVisualizer ( ReactClass , componentId ) {
248
+
249
+ if ( typeof shouldInstrumentComponent === 'function' && ! shouldInstrumentComponent ( ReactClass ) ) {
250
+ return ReactClass ;
251
+ }
252
+
253
+ const old = {
254
+ componentDidMount : ReactClass . prototype . componentDidMount ,
255
+ componentDidUpdate : ReactClass . prototype . componentDidUpdate ,
256
+ componentWillUnmount : ReactClass . prototype . componentWillUnmount
257
+ } ;
258
+
259
+ ReactClass . prototype . componentDidMount = function ( ) {
260
+ renders . set ( this , {
261
+ id : window . __reactRendersCount ++ ,
262
+ log : [ ] ,
263
+ count : 0 ,
264
+
265
+ posTop : 0 ,
266
+ posLeft : 0
267
+ } ) ;
268
+ addToRenderLog ( this , 'Initial Render' ) ;
269
+
270
+ if ( old . componentDidMount ) {
271
+ return old . componentDidMount . apply ( this , [ ...arguments ] ) ;
272
+ }
273
+ } ;
274
+ ReactClass . prototype . componentDidUpdate = function ( prevProps , prevState ) {
275
+ addToRenderLog ( this , getReasonForReRender ( prevProps , prevState , this . props , this . state ) ) ;
276
+
277
+ if ( old . componentDidUpdate ) {
278
+ return old . componentDidUpdate . apply ( this , [ ...arguments ] ) ;
279
+ }
280
+ } ;
281
+ ReactClass . prototype . componentWillUnmount = function ( ) {
282
+ renders . delete ( this ) ;
283
+
284
+ if ( old . componentWillUnmount ) {
285
+ return old . componentWillUnmount . apply ( this , [ ...arguments ] ) ;
286
+ }
287
+ } ;
288
+
289
+ return ReactClass ;
290
+ } ;
291
+ }
292
292
}
0 commit comments