Skip to content

Commit

Permalink
improved warning in ReactUpdateQueue (#7326)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3fd5826)
  • Loading branch information
keyz authored and zpao committed Jul 21, 2016
1 parent 2106bf5 commit 807244b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/renderers/shared/stack/reconciler/ReactUpdateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down

0 comments on commit 807244b

Please sign in to comment.