@samitouri / QOS-React / commits / 3fd582643e

improved warning in ReactUpdateQueue (#7326)

Keyan Zhang committed Jul 21, 2016 at 04:41 UTC 3fd582643ef3d222a00a0c756292c15b88f9f83c
1 file changed +2 -1
src/renderers/shared/stack/reconciler/ReactUpdateQueue.js
+2 -1
@@ -40,6 +40,7 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
40 var internalInstance = ReactInstanceMap.get(publicInstance);
41 if (!internalInstance) {
42 if (__DEV__) {
43 + var ctor = publicInstance.constructor;
44 // Only warn when we have a callerName. Otherwise we should be silent.
45 // We're probably calling from enqueueCallback. We don't want to warn
46 // there because we already warned for the corresponding lifecycle method.
@@ -50,7 +51,7 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
51 'This is a no-op. Please check the code for the %s component.',
52 callerName,
53 callerName,
53 - publicInstance.constructor.displayName
54 + ctor && (ctor.displayName || ctor.name) || 'ReactClass'
55 );
56 }
57 return null;