Add config to enable sync scheduling by default
I'll turn this on in ReactDOMFiber once I figure out batchedUpdates.
Andrew Clark committed
Oct 28, 2016 at 11:44 UTC
78aef38bfa6865b409b30ce143c50635f93b3cc3
2 files changed
+6
-2
src/renderers/shared/fiber/ReactFiberReconciler.js
+2
-1
@@ -56,8 +56,9 @@ export type HostConfig<T, P, I, TI, C> = {
56
removeChild(parentInstance : I, child : I | TI) : void,
57
58
scheduleAnimationCallback(callback : () => void) : void,
59
- scheduleDeferredCallback(callback : (deadline : Deadline) => void) : void
59
+ scheduleDeferredCallback(callback : (deadline : Deadline) => void) : void,
60
61
+ useSyncScheduling ?: boolean,
62
};
63
64
type OpaqueNode = Fiber;
src/renderers/shared/fiber/ReactFiberScheduler.js
+4
-1
@@ -62,11 +62,14 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
62
63
const scheduleAnimationCallback = config.scheduleAnimationCallback;
64
const scheduleDeferredCallback = config.scheduleDeferredCallback;
65
+ const useSyncScheduling = config.useSyncScheduling;
66
67
// The priority level to use when scheduling an update.
68
let priorityContext : (PriorityLevel | null) = null;
69
// The priority level to use if there is no priority context.
69
- let defaultPriorityContext : PriorityLevel = LowPriority;
70
+ let defaultPriorityContext : PriorityLevel = useSyncScheduling ?
71
+ SynchronousPriority :
72
+ LowPriority;
73
74
// The next work in progress fiber that we're currently working on.
75
let nextUnitOfWork : ?Fiber = null;