@@ -74,7 +74,7 @@ import {
7474} from 'react-reconciler/src/ReactWorkTags' ;
7575import { listenToAllSupportedEvents } from '../events/DOMPluginEventSystem' ;
7676
77- import { UnknownEventPriority } from 'react-reconciler/src/ReactEventPriorities' ;
77+ import { DefaultEventPriority } from 'react-reconciler/src/ReactEventPriorities' ;
7878
7979// TODO: Remove this deep import when we delete the legacy root API
8080import { ConcurrentMode , NoMode } from 'react-reconciler/src/ReactTypeOfMode' ;
@@ -374,7 +374,7 @@ export function createTextInstance(
374374export function getCurrentEventPriority ( ) : EventPriority {
375375 const currentEvent = window . event ;
376376 if ( currentEvent === undefined ) {
377- return UnknownEventPriority ;
377+ return DefaultEventPriority ;
378378 }
379379 return getEventPriority ( currentEvent . type ) ;
380380}
@@ -414,21 +414,21 @@ export const scheduleMicrotask: any =
414414 . catch ( handleErrorInNextTick )
415415 : scheduleTimeout ; // TODO: Determine the best fallback here.
416416
417- // TODO: Fix these types
418417export const supportsFrameAlignedTask = true ;
419418
420419type FrameAlignedTask = { |
421- rafNode : number ,
420+ rafNode : AnimationFrameID ,
422421 schedulerNode : number ,
423422 task : function ,
424423| } ;
425424
426425let currentTask : FrameAlignedTask | null = null ;
427426function performFrameAlignedWork ( ) {
428- if ( currentTask != null ) {
429- const task = currentTask . task ;
430- localCancelAnimationFrame ( currentTask . id ) ;
431- Scheduler . unstable_cancelCallback ( currentTask . schedulerNode ) ;
427+ const constCurrentTask = currentTask ;
428+ if ( constCurrentTask != null ) {
429+ const task = constCurrentTask . task ;
430+ localCancelAnimationFrame ( constCurrentTask . rafNode ) ;
431+ Scheduler . unstable_cancelCallback ( constCurrentTask . schedulerNode ) ;
432432 currentTask = null ;
433433 if ( task != null ) {
434434 task ( ) ;
@@ -461,9 +461,8 @@ export function scheduleFrameAlignedTask(task: any): any {
461461 return currentTask ;
462462}
463463
464- export function cancelFrameAlignedTask ( task : FrameAlignedTask ) {
464+ export function cancelFrameAlignedTask ( task : any ) {
465465 Scheduler . unstable_cancelCallback ( task . schedulerNode ) ;
466- task . schedulerNode = null ;
467466 // We don't cancel the rAF in case it gets re-used later.
468467 // But clear the task so if it fires and shouldn't run, it won't.
469468 task . task = null ;
0 commit comments