diff --git a/src/renderers/shared/reconciler/ReactUpdateQueue.js b/src/renderers/shared/reconciler/ReactUpdateQueue.js index 0c5e325a8d351..f94781e0243b8 100644 --- a/src/renderers/shared/reconciler/ReactUpdateQueue.js +++ b/src/renderers/shared/reconciler/ReactUpdateQueue.js @@ -109,8 +109,10 @@ var ReactUpdateQueue = { invariant( typeof callback === 'function', 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + - '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + - 'isn\'t callable.' + '`setState`, `replaceState`, or `forceUpdate` with a callback of type ' + + '%s. A function is expected', + typeof callback === 'object' && Object.keys(callback).length && Object.keys(callback).length < 20 ? + 'type ' + typeof callback + ' (keys: ' + Object.keys(callback) + ')' : typeof callback; ); var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); @@ -136,12 +138,14 @@ var ReactUpdateQueue = { }, enqueueCallbackInternal: function(internalInstance, callback) { - invariant( - typeof callback === 'function', - 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + - '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + - 'isn\'t callable.' - ); + invariant( + typeof callback === 'function', + 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + + '`setState`, `replaceState`, or `forceUpdate` with a callback of type ' + + '%s. A function is expected', + typeof callback === 'object' && Object.keys(callback).length && Object.keys(callback).length < 20 ? + 'type ' + typeof callback + ' (keys: ' + Object.keys(callback) + ')' : typeof callback; + ); if (internalInstance._pendingCallbacks) { internalInstance._pendingCallbacks.push(callback); } else {