Skip to content

Commit eaac489

Browse files
author
Tim Robertson
committed
spaces instead of tabs
1 parent 9195c05 commit eaac489

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

src/renderWrapper.js

+46-46
Original file line numberDiff line numberDiff line change
@@ -243,50 +243,50 @@ window.setInterval(() => {
243243
ReactDOM.render(React.createElement(RenderLogs, { renders: renders }), containingElement);
244244

245245
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+
}
292292
}

src/specify.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = require('./renderWrapper')(function(ReactClass) {
2-
return !!ReactClass.rerenderViz;
2+
return !!ReactClass.rerenderViz;
33
});

0 commit comments

Comments
 (0)