From 5920cf28079a171bdbb4b7443c38abbe823d5a1e Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Thu, 21 Jul 2016 00:26:56 -0700 Subject: [PATCH] improved warning in ReactUpdateQueue --- src/renderers/shared/stack/reconciler/ReactUpdateQueue.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js b/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js index 9d4071cc3ffe9..1b555520a7833 100644 --- a/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js +++ b/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js @@ -40,6 +40,7 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) { var internalInstance = ReactInstanceMap.get(publicInstance); if (!internalInstance) { if (__DEV__) { + var ctor = publicInstance.constructor; // Only warn when we have a callerName. Otherwise we should be silent. // We're probably calling from enqueueCallback. We don't want to warn // there because we already warned for the corresponding lifecycle method. @@ -50,7 +51,7 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) { 'This is a no-op. Please check the code for the %s component.', callerName, callerName, - publicInstance.constructor.displayName + ctor && (ctor.displayName || ctor.name) || 'ReactClass' ); } return null;