Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cancelDeferredCallback: ReactScheduler.unstable_cancelCallback,
shouldYield: ReactScheduler.unstable_shouldYield,
scheduleTimeout: setTimeout,
cancelTimeout: clearTimeout,
setTimeout: setTimeout,
clearTimeout: clearTimeout,
noTimeout: -1,
// Commit hooks, useful mainly for react-dom syntethic events
prepareForCommit() {},
resetAfterCommit() {},
now: ReactScheduler.unstable_now,
isPrimaryRenderer: true,
//useSyncScheduling: true,
supportsMutation: true,
commitUpdate(
domElement,
updatePayload,
type,
oldProps,
newProps,
internalInstanceHandle
) {},
commitMount(domElement, type, newProps, internalInstanceHandle) {},
commitTextUpdate(textInstance, oldText, newText) {
textInstance.setText(newText);
},
ChildSet,
TimeoutHandle,
NoTimeout
> = {
//https://github.com/sencha/ext-react/issues/306#issuecomment-521906095
scheduleDeferredCallback: scheduler.unstable_scheduleCallback,
cancelDeferredCallback: scheduler.unstable_cancelCallback,
// @ts-ignore not in typings
schedulePassiveEffects: scheduler.unstable_scheduleCallback,
cancelPassiveEffects: scheduler.unstable_cancelCallback,
// @ts-ignore not in typings
shouldYield: scheduler.unstable_shouldYield,
now: scheduler.unstable_now,
getPublicInstance(instance: Instance | TextInstance): PublicInstance {
// TODO (this was a complete guess).
return instance;
},
getRootHostContext(rootContainerInstance: Container): HostContext {
return {
isInAParentText: false,
isInADockLayout: false,
isInAGridLayout: false,
isInAnAbsoluteLayout: false,
isInAFlexboxLayout: false,
};
},
getChildHostContext(parentHostContext: HostContext, type: Type, rootContainerInstance: Container): HostContext {
/*
* Given the following, wrapped in a Page:
get: function get() {
return _scheduler.unstable_now;
}
});