@samitouri / QOS-React-2 / commits / 3bf12bba0d

add displayName to component spec functions

closes #992

Paul O'Shannessy committed Apr 11, 2014 at 16:36 UTC 3bf12bba0d650383c5b9a9140f2aa2d034e7a017
1 file changed +7
src/core/ReactCompositeComponent.js
+7
@@ -494,6 +494,13 @@ function mixSpecIntoComponent(ConvenienceConstructor, spec) {
494 }
495 } else {
496 proto[name] = property;
497 + if (__DEV__) {
498 + // Add verbose displayName to the function, which helps when looking
499 + // at profiling tools.
500 + if (typeof property === 'function' && spec.displayName) {
501 + proto[name].displayName = spec.displayName + '_' + name;
502 + }
503 + }
504 }
505 }
506 }