Create ReactGenericBatching injection wrapper around BatchedUpdates

This moves calls that don't know if they're in a Fiber or Stack
context to use ReactGenericBatching.batchedUpdates.

The corresponding one will be injected from either the stack
reconciler and/or the fiber reconciler if they're loaded at the
same time.

This lets them share the event system when they're both used
at once.

This can also be useful for libraries that call
unstable_batchedUpdates today but don't know which renderer to
use.
This commit is contained in:
Sebastian Markbage committed 2016-10-27 18:57:30 -07:00
1 parent 2f8d1689db
commit ea47782aaa
6 files changed
+69 -6

No files matched your search

@@ -19,6 +19,7 @@ var ReactDOMEmptyComponent = require('ReactDOMEmptyComponent');
var ReactDOMTextComponent = require('ReactDOMTextComponent');
var ReactDefaultBatchingStrategy = require('ReactDefaultBatchingStrategy');
var ReactEmptyComponent = require('ReactEmptyComponent');
var ReactGenericBatching = require('ReactGenericBatching');
var ReactHostComponent = require('ReactHostComponent');
var ReactReconcileTransaction = require('ReactReconcileTransaction');
var ReactUpdates = require('ReactUpdates');
@@ -34,6 +35,10 @@ function inject() {
}
alreadyInjected = true;
ReactGenericBatching.injection.injectStackBatchedUpdates(
ReactUpdates.batchedUpdates
);
ReactHostComponent.injection.injectGenericComponentClass(
ReactDOMComponent
);