Dev.Lib
arrow_backBack to Blogs
LEVEL_088.3June 27, 20261 min read

Scheduler internals

Concurrency & Streams

React Scheduler (and browser `scheduler.postTask`) coordinate with `isInputPending` — cooperative multitasking.

Summary

React Scheduler (and browser scheduler.postTask) coordinate with isInputPending — cooperative multitasking. shouldYield ends slice. Not OS thread scheduler — still single main thread. Understanding helps debug why transitions defer but clicks don't.

Code example

if ('scheduler' in globalThis && 'postTask' in scheduler) {
  scheduler.postTask(() => heavyWork(), { priority: 'background' });
} else {
  requestIdleCallback(() => heavyWork());
}

Key points

  • React Scheduler (and browser scheduler.postTask) coordinate with isInputPending — cooperative multitasking.
  • shouldYield ends slice.
  • Not OS thread scheduler — still single main thread.
  • Understanding helps debug why transitions defer but clicks don't.

Further reading

Related concepts