Skip to content

Commit

Permalink
update enqueueCallback invariant to more specifically explain what ca…
Browse files Browse the repository at this point in the history
…used error
  • Loading branch information
conorhastings committed Oct 16, 2015
1 parent ed7ab7b commit 97abe0c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/renderers/shared/reconciler/ReactUpdateQueue.js
Expand Up @@ -109,8 +109,9 @@ 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
);
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);

Expand Down Expand Up @@ -139,8 +140,9 @@ 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
);
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
Expand Down

0 comments on commit 97abe0c

Please sign in to comment.