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

Function addFiberToLanesMap

packages/react-reconciler/src/ReactFiberLane.js:1153–1174  ·  view source on GitHub ↗
(
  root: FiberRoot,
  fiber: Fiber,
  lanes: Lanes | Lane,
)

Source from the content-addressed store, hash-verified

1151}
1152
1153export function addFiberToLanesMap(
1154 root: FiberRoot,
1155 fiber: Fiber,
1156 lanes: Lanes | Lane,
1157) {
1158 if (!enableUpdaterTracking) {
1159 return;
1160 }
1161 if (!isDevToolsPresent) {
1162 return;
1163 }
1164 const pendingUpdatersLaneMap = root.pendingUpdatersLaneMap;
1165 while (lanes > 0) {
1166 const index = laneToIndex(lanes);
1167 const lane = 1 << index;
1168
1169 const updaters = pendingUpdatersLaneMap[index];
1170 updaters.add(fiber);
1171
1172 lanes &= ~lane;
1173 }
1174}
1175
1176export function movePendingFibersToMemoized(root: FiberRoot, lanes: Lanes) {
1177 if (!enableUpdaterTracking) {

Callers 2

scheduleUpdateOnFiberFunction · 0.90
restorePendingUpdatersFunction · 0.90

Calls 2

laneToIndexFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected