MCPcopy Index your code
hub / github.com/react/react / enqueueForceUpdate

Function enqueueForceUpdate

packages/react-reconciler/src/ReactFiberClassComponent.js:218–242  ·  view source on GitHub ↗
(inst: any, callback)

Source from the content-addressed store, hash-verified

216 },
217 // $FlowFixMe[missing-local-annot]
218 enqueueForceUpdate(inst: any, callback) {
219 const fiber = getInstance(inst);
220 const lane = requestUpdateLane(fiber);
221
222 const update = createUpdate(lane);
223 update.tag = ForceUpdate;
224
225 if (callback !== undefined && callback !== null) {
226 if (__DEV__) {
227 warnOnInvalidCallback(callback);
228 }
229 update.callback = callback;
230 }
231
232 const root = enqueueUpdate(fiber, update, lane);
233 if (root !== null) {
234 startUpdateTimerByLane(lane, 'this.forceUpdate()', fiber);
235 scheduleUpdateOnFiber(root, fiber, lane);
236 entangleTransitions(root, fiber, lane);
237 }
238
239 if (enableSchedulingProfiler) {
240 markForceUpdateScheduled(fiber, lane);
241 }
242 },
243};
244
245function checkShouldComponentUpdate(

Callers

nothing calls this directly

Calls 9

requestUpdateLaneFunction · 0.90
createUpdateFunction · 0.90
enqueueUpdateFunction · 0.90
startUpdateTimerByLaneFunction · 0.90
scheduleUpdateOnFiberFunction · 0.90
entangleTransitionsFunction · 0.90
markForceUpdateScheduledFunction · 0.90
getInstanceFunction · 0.85
warnOnInvalidCallbackFunction · 0.70

Tested by

no test coverage detected