mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Make "unexpected batch number" a warning (#7133)
This was added to catch internal errors in React but doesn't seem to be doing much good except frustrating people more when their apps throw (#6895, FB-internal t11950821). Until more proper error boundaries land, let's make this a warning.
(cherry picked from commit abcd567325)
This commit is contained in:
committed by
Paul O’Shannessy
parent
891e087926
commit
d441128bf6
@@ -14,7 +14,7 @@
|
||||
var ReactRef = require('ReactRef');
|
||||
var ReactInstrumentation = require('ReactInstrumentation');
|
||||
|
||||
var invariant = require('invariant');
|
||||
var warning = require('warning');
|
||||
|
||||
/**
|
||||
* Helper to call ReactRef.attachRefs with this composite component, split out
|
||||
@@ -206,7 +206,7 @@ var ReactReconciler = {
|
||||
if (internalInstance._updateBatchNumber !== updateBatchNumber) {
|
||||
// The component's enqueued batch number should always be the current
|
||||
// batch or the following one.
|
||||
invariant(
|
||||
warning(
|
||||
internalInstance._updateBatchNumber == null ||
|
||||
internalInstance._updateBatchNumber === updateBatchNumber + 1,
|
||||
'performUpdateIfNecessary: Unexpected batch number (current %s, ' +
|
||||
|
||||
Reference in New Issue
Block a user