From 3fd582643ef3d222a00a0c756292c15b88f9f83c Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Thu, 21 Jul 2016 04:41:31 -0700 Subject: [PATCH] improved warning in ReactUpdateQueue (#7326) --- 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 9d4071cc3f..1b555520a7 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;