Skip to content

Commit 562234c

Browse files
committed
reuse type defined in scheduler
type Callback is defined in the Scheduler package. Meanwhile: 1.In ReactFiberWorkLoop.js, the callback variable is not explicitly typed. 2.The RenderTaskFn type is defined in ReactFiberRootScheduler.js. While it requires a didTimeout parameter, this argument isn’t necessarily essential in all scenarios.
1 parent ef8b6fa commit 562234c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-reconciler/src/Scheduler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
2525
export const NormalPriority = Scheduler.unstable_NormalPriority;
2626
export const LowPriority = Scheduler.unstable_LowPriority;
2727
export const IdlePriority = Scheduler.unstable_IdlePriority;
28-
export type SchedulerCallback = (isSync: boolean) => SchedulerCallback | null;
28+
export type {Callback as SchedulerCallback} from 'scheduler';
2929

3030
// this doesn't actually exist on the scheduler, but it *does*
3131
// on scheduler/unstable_mock, which we'll need for internal testing

0 commit comments

Comments
 (0)