diff --git a/src/isomorphic/classic/class/ReactClass.js b/src/isomorphic/classic/class/ReactClass.js index 74c25242a66..4710160765c 100644 --- a/src/isomorphic/classic/class/ReactClass.js +++ b/src/isomorphic/classic/class/ReactClass.js @@ -27,6 +27,8 @@ var warning = require('warning'); var MIXINS_KEY = keyOf({mixins: null}); +var ReactPerf = require('ReactPerf'); + /** * Policies that describe methods in `ReactClassInterface`. */ @@ -900,6 +902,16 @@ var ReactClass = { for (var methodName in ReactClassInterface) { if (!Constructor.prototype[methodName]) { Constructor.prototype[methodName] = null; + } else { + if (__DEV__) { + // spec is the user-defined component + // hijack the defined lifecycle methods and wrap with Perf + spec[methodName] = ReactPerf.measure( + spec.displayName, + methodName, + spec[methodName] + ); + } } }