mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Expose ReactReconciler
This can be used by devtools to monkey patch the reconciler and therefore get notified whenever any internal instance is updated.
This commit is contained in:
@@ -100,6 +100,20 @@ var ReactReconciler = {
|
||||
if (refsChanged) {
|
||||
transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Flush any dirty changes in a component.
|
||||
*
|
||||
* @param {ReactComponent} internalInstance
|
||||
* @param {ReactReconcileTransaction} transaction
|
||||
* @internal
|
||||
*/
|
||||
performUpdateIfNecessary: function(
|
||||
internalInstance,
|
||||
transaction
|
||||
) {
|
||||
internalInstance.performUpdateIfNecessary(transaction);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -15,6 +15,7 @@ var CallbackQueue = require('CallbackQueue');
|
||||
var PooledClass = require('PooledClass');
|
||||
var ReactCurrentOwner = require('ReactCurrentOwner');
|
||||
var ReactPerf = require('ReactPerf');
|
||||
var ReactReconciler = require('ReactReconciler');
|
||||
var Transaction = require('Transaction');
|
||||
|
||||
var assign = require('Object.assign');
|
||||
@@ -146,7 +147,11 @@ function runBatchedUpdates(transaction) {
|
||||
// stash the callbacks first
|
||||
var callbacks = component._pendingCallbacks;
|
||||
component._pendingCallbacks = null;
|
||||
component.performUpdateIfNecessary(transaction.reconcileTransaction);
|
||||
|
||||
ReactReconciler.performUpdateIfNecessary(
|
||||
component,
|
||||
transaction.reconcileTransaction
|
||||
);
|
||||
|
||||
if (callbacks) {
|
||||
for (var j = 0; j < callbacks.length; j++) {
|
||||
|
||||
Reference in New Issue
Block a user