25
import type {
26
OffscreenState,
27
OffscreenInstance,
28
+ OffscreenQueue,
29
} from './ReactFiberOffscreenComponent';
30
import type {HookFlags} from './ReactHookEffectTags';
31
import type {Cache} from './ReactFiberCacheComponent.new';
2878
2879
if (enableTransitionTracing) {
2880
const isFallback = finishedWork.memoizedState;
2880
- const queue = (finishedWork.updateQueue: any);
2881
- const instance = finishedWork.stateNode;
2881
+ const queue: OffscreenQueue = (finishedWork.updateQueue: any);
2882
+ const instance: OffscreenInstance = finishedWork.stateNode;
2883
2884
if (queue !== null) {
2885
if (isFallback) {
2897
// Add all the transitions saved in the update queue during
2898
// the render phase (ie the transitions associated with this boundary)
2899
// into the transitions set.
2899
- prevTransitions.add(transition);
2900
+ if (prevTransitions === null) {
2901
+ // TODO: What if prevTransitions is null?
2902
+ } else {
2903
+ prevTransitions.add(transition);
2904
+ }
2905
});
2906
}
2907
2918
// caused them
2919
if (markerTransitions !== null) {
2920
markerTransitions.forEach(transition => {
2916
- if (instance.transitions.has(transition)) {
2917
- instance.pendingMarkers.add(
2918
- markerInstance.pendingSuspenseBoundaries,
2919
- );
2921
+ if (instance.transitions === null) {
2922
+ // TODO: What if instance.transitions is null?
2923
+ } else {
2924
+ if (instance.transitions.has(transition)) {
2925
+ if (
2926
+ instance.pendingMarkers === null ||
2927
+ markerInstance.pendingSuspenseBoundaries === null
2928
+ ) {
2929
+ // TODO: What if instance.pendingMarkers is null?
2930
+ // TODO: What if markerInstance.pendingSuspenseBoundaries is null?
2931
+ } else {
2932
+ instance.pendingMarkers.add(
2933
+ markerInstance.pendingSuspenseBoundaries,
2934
+ );
2935
+ }
2936
+ }
2937
}
2938
});
2939
}