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.
Sebastian Markbåge committed
Apr 1, 2025 at 18:18 UTC
450f8df8865303f14be7ddd7c951f020115aa27c
2 files changed
+2
-5
packages/react-reconciler/src/ReactFiberRoot.js
+1
-4
@@ -112,10 +112,7 @@ function FiberRootNode(
112
this.incompleteTransitions = new Map();
113
if (enableTransitionTracing) {
114
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);
116
}
117
118
if (enableProfilerTimer && enableProfilerCommitHooks) {
packages/react-reconciler/src/ReactInternalTypes.js
+1
-1
@@ -357,7 +357,7 @@ export type TransitionTracingCallbacks = {
357
// The following fields are only used in transition tracing in Profile builds
358
type TransitionTracingOnlyFiberRootProperties = {
359
transitionCallbacks: null | TransitionTracingCallbacks,
360
- transitionLanes: Array<Set<Transition> | null>,
360
+ transitionLanes: LaneMap<Set<Transition> | null>,
361
// Transitions on the root can be represented as a bunch of tracing markers.
362
// Each entangled group of transitions can be treated as a tracing marker.
363
// It will have a set of pending suspense boundaries. These transitions