Skip to content

Commit 450f8df

Browse files
authored
Clarify that the transitionLanes used by Transition Tracing is a LaneMap (#32800)
We have a high level concept for this used elsewhere. We should use this for `transitionTypes` too: https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactInternalTypes.js#L285 As mentioned in #32797 we could also just use the `transitionLanes` since the `types` are also on the `Transition` objects. If we always stored this set.
1 parent 7a728df commit 450f8df

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

packages/react-reconciler/src/ReactFiberRoot.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,7 @@ function FiberRootNode(
112112
this.incompleteTransitions = new Map();
113113
if (enableTransitionTracing) {
114114
this.transitionCallbacks = null;
115-
const transitionLanesMap = (this.transitionLanes = []);
116-
for (let i = 0; i < TotalLanes; i++) {
117-
transitionLanesMap.push(null);
118-
}
115+
this.transitionLanes = createLaneMap(null);
119116
}
120117

121118
if (enableProfilerTimer && enableProfilerCommitHooks) {

packages/react-reconciler/src/ReactInternalTypes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ export type TransitionTracingCallbacks = {
357357
// The following fields are only used in transition tracing in Profile builds
358358
type TransitionTracingOnlyFiberRootProperties = {
359359
transitionCallbacks: null | TransitionTracingCallbacks,
360-
transitionLanes: Array<Set<Transition> | null>,
360+
transitionLanes: LaneMap<Set<Transition> | null>,
361361
// Transitions on the root can be represented as a bunch of tracing markers.
362362
// Each entangled group of transitions can be treated as a tracing marker.
363363
// It will have a set of pending suspense boundaries. These transitions

0 commit comments

Comments
 (0)