MCPcopy
hub / github.com/facebook/react / scheduleRefresh

Function scheduleRefresh

packages/react-reconciler/src/ReactFiberHotReloading.js:222–240  ·  view source on GitHub ↗
(
  root: FiberRoot,
  update: RefreshUpdate,
)

Source from the content-addressed store, hash-verified

220}
221
222export const scheduleRefresh: ScheduleRefresh = (
223 root: FiberRoot,
224 update: RefreshUpdate,
225): void => {
226 if (__DEV__) {
227 if (resolveFamily === null) {
228 // Hot reloading is disabled.
229 return;
230 }
231 const {staleFamilies, updatedFamilies} = update;
232 flushPendingEffects();
233 scheduleFibersWithFamiliesRecursively(
234 root.current,
235 updatedFamilies,
236 staleFamilies,
237 );
238 flushSyncWork();
239 }
240};
241
242export const scheduleRoot: ScheduleRoot = (
243 root: FiberRoot,

Callers 1

attachFunction · 0.85

Calls 3

flushPendingEffectsFunction · 0.90
flushSyncWorkFunction · 0.90

Tested by

no test coverage detected