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

Function getTransitionsForLanes

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

Source from the content-addressed store, hash-verified

1220}
1221
1222export function getTransitionsForLanes(
1223 root: FiberRoot,
1224 lanes: Lane | Lanes,
1225): Array<Transition> | null {
1226 if (!enableTransitionTracing) {
1227 return null;
1228 }
1229
1230 const transitionsForLanes = [];
1231 while (lanes > 0) {
1232 const index = laneToIndex(lanes);
1233 const lane = 1 << index;
1234 const transitions = root.transitionLanes[index];
1235 if (transitions !== null) {
1236 transitions.forEach(transition => {
1237 transitionsForLanes.push(transition);
1238 });
1239 }
1240
1241 lanes &= ~lane;
1242 }
1243
1244 if (transitionsForLanes.length === 0) {
1245 return null;
1246 }
1247
1248 return transitionsForLanes;
1249}
1250
1251export function clearTransitionsForLanes(root: FiberRoot, lanes: Lane | Lanes) {
1252 if (!enableTransitionTracing) {

Callers 2

renderRootSyncFunction · 0.90
renderRootConcurrentFunction · 0.90

Calls 3

laneToIndexFunction · 0.85
forEachMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected