Schedules non-critical work to run when the JavaScript thread is idle, so it
does not compete with navigation transitions, list scrolling or gesture
handling for the same frame budget. Backed by React's scheduler package at
idle priority — the same cooperative priority queue the React runtime uses to
interleave work — so idle tasks yield to renders, gestures and transitions and
run only once nothing more urgent is pending.
This is deliberately not requestIdleCallback: React Native (Hermes / JSC)
does not provide that DOM API, so a wrapper around it would silently degrade
to a plain setTimeout on device. scheduler ships with React, works
uniformly across engines, and is the primitive requestIdleCallback polyfills
themselves delegate to.
Use this for work whose result is not needed for the current frame but is
worth doing before the user asks for it — e.g. warming a search index after
its corpus changes so the first query is instant.
idle - Cooperative idle-time scheduling
Schedules non-critical work to run when the JavaScript thread is idle, so it does not compete with navigation transitions, list scrolling or gesture handling for the same frame budget. Backed by React's
schedulerpackage at idle priority — the same cooperative priority queue the React runtime uses to interleave work — so idle tasks yield to renders, gestures and transitions and run only once nothing more urgent is pending.This is deliberately not
requestIdleCallback: React Native (Hermes / JSC) does not provide that DOM API, so a wrapper around it would silently degrade to a plainsetTimeouton device.schedulerships with React, works uniformly across engines, and is the primitiverequestIdleCallbackpolyfills themselves delegate to.Use this for work whose result is not needed for the current frame but is worth doing before the user asks for it — e.g. warming a search index after its corpus changes so the first query is instant.