mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add config to enable sync scheduling by default
I'll turn this on in ReactDOMFiber once I figure out batchedUpdates.
This commit is contained in:
1 parent
7b9ae92058
commit
78aef38bfa
2 files changed
+6
-2
No files matched your search
@@ -56,8 +56,9 @@ export type HostConfig<T, P, I, TI, C> = {
|
||||
removeChild(parentInstance : I, child : I | TI) : void,
|
||||
|
||||
scheduleAnimationCallback(callback : () => void) : void,
|
||||
scheduleDeferredCallback(callback : (deadline : Deadline) => void) : void
|
||||
scheduleDeferredCallback(callback : (deadline : Deadline) => void) : void,
|
||||
|
||||
useSyncScheduling ?: boolean,
|
||||
};
|
||||
|
||||
type OpaqueNode = Fiber;
|
||||
|
||||
@@ -62,11 +62,14 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
|
||||
|
||||
const scheduleAnimationCallback = config.scheduleAnimationCallback;
|
||||
const scheduleDeferredCallback = config.scheduleDeferredCallback;
|
||||
const useSyncScheduling = config.useSyncScheduling;
|
||||
|
||||
// The priority level to use when scheduling an update.
|
||||
let priorityContext : (PriorityLevel | null) = null;
|
||||
// The priority level to use if there is no priority context.
|
||||
let defaultPriorityContext : PriorityLevel = LowPriority;
|
||||
let defaultPriorityContext : PriorityLevel = useSyncScheduling ?
|
||||
SynchronousPriority :
|
||||
LowPriority;
|
||||
|
||||
// The next work in progress fiber that we're currently working on.
|
||||
let nextUnitOfWork : ?Fiber = null;
|
||||
|
||||
Reference in new issue
Block a user