@@ -2269,7 +2269,7 @@ export function attach(
22692269
22702270 // This is a naive implementation that shallowly recourses children.
22712271 // We might want to revisit this if it proves to be too inefficient.
2272- let child = childSet;
2272+ let child: null | Fiber = childSet;
22732273 while (child !== null) {
22742274 findReorderedChildrenRecursively ( child , nextChildren ) ;
22752275 child = child . sibling ;
@@ -2846,11 +2846,11 @@ export function attach(
28462846 // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js
28472847 function getNearestMountedFiber ( fiber : Fiber ) : null | Fiber {
28482848 let node = fiber ;
2849- let nearestMounted = fiber ;
2849+ let nearestMounted : null | Fiber = fiber ;
28502850 if ( ! fiber . alternate ) {
28512851 // If there is no alternate, this might be a new tree that isn't inserted
28522852 // yet. If it is, then it will have a pending insertion effect on it.
2853- let nextNode = node ;
2853+ let nextNode : Fiber = node ;
28542854 do {
28552855 node = nextNode ;
28562856 if ( ( node . flags & ( Placement | Hydrating ) ) !== NoFlags ) {
@@ -2859,6 +2859,7 @@ export function attach(
28592859 // if that one is still mounted.
28602860 nearestMounted = node . return ;
28612861 }
2862+ // $FlowFixMe[incompatible-type] we bail out when we get a null
28622863 nextNode = node . return ;
28632864 } while ( nextNode ) ;
28642865 } else {
@@ -3097,7 +3098,7 @@ export function attach(
30973098 const owners: Array< SerializedElement > = [fiberToSerializedElement(fiber)];
30983099
30993100 if (_debugOwner) {
3100- let owner = _debugOwner ;
3101+ let owner : null | Fiber = _debugOwner ;
31013102 while ( owner !== null ) {
31023103 owners . unshift ( fiberToSerializedElement ( owner ) ) ;
31033104 owner = owner . _debugOwner || null ;
@@ -3256,7 +3257,7 @@ export function attach(
32563257 let owners = null;
32573258 if (_debugOwner) {
32583259 owners = [ ] ;
3259- let owner = _debugOwner ;
3260+ let owner : null | Fiber = _debugOwner ;
32603261 while ( owner !== null ) {
32613262 owners . push ( fiberToSerializedElement ( owner ) ) ;
32623263 owner = owner . _debugOwner || null ;
@@ -3687,18 +3688,22 @@ export function attach(
36873688 // This will enable us to send patches without re-inspecting if hydrated paths are requested.
36883689 // (Reducing how often we shallow-render is a better DX for function components that use hooks.)
36893690 const cleanedInspectedElement = { ...mostRecentlyInspectedElement } ;
3691+ // $FlowFixMe[prop-missing] found when upgrading Flow
36903692 cleanedInspectedElement.context = cleanForBridge(
36913693 cleanedInspectedElement.context,
36923694 createIsPathAllowed('context', null),
36933695 );
3696+ // $FlowFixMe[prop-missing] found when upgrading Flow
36943697 cleanedInspectedElement.hooks = cleanForBridge(
36953698 cleanedInspectedElement.hooks,
36963699 createIsPathAllowed('hooks', 'hooks'),
36973700 );
3701+ // $FlowFixMe[prop-missing] found when upgrading Flow
36983702 cleanedInspectedElement.props = cleanForBridge(
36993703 cleanedInspectedElement.props,
37003704 createIsPathAllowed('props', null),
37013705 );
3706+ // $FlowFixMe[prop-missing] found when upgrading Flow
37023707 cleanedInspectedElement.state = cleanForBridge(
37033708 cleanedInspectedElement.state,
37043709 createIsPathAllowed('state', null),
@@ -3709,6 +3714,7 @@ export function attach(
37093714 responseID : requestID ,
37103715 type : 'full-data' ,
37113716 // $FlowFixMe[incompatible-return] found when upgrading Flow
3717+ // $FlowFixMe[prop-missing] found when upgrading Flow
37123718 value : cleanedInspectedElement ,
37133719 } ;
37143720 }
@@ -4420,13 +4426,15 @@ export function attach(
44204426 // The return path will contain Fibers that are "invisible" to the store
44214427 // because their keys and indexes are important to restoring the selection.
44224428 function getPathForElement ( id : number ) : Array < PathFrame > | null {
4423- let fiber = idToArbitraryFiberMap . get ( id ) ;
4429+ let fiber : ? Fiber = idToArbitraryFiberMap . get ( id ) ;
44244430 if ( fiber == null ) {
44254431 return null ;
44264432 }
44274433 const keyPath = [ ] ;
44284434 while ( fiber !== null ) {
4435+ // $FlowFixMe[incompatible-call] found when upgrading Flow
44294436 keyPath. push ( getPathFrame ( fiber ) ) ;
4437+ // $FlowFixMe[incompatible-use] found when upgrading Flow
44304438 fiber = fiber . return ;
44314439 }
44324440 keyPath.reverse();
@@ -4443,7 +4451,7 @@ export function attach(
44434451 return null ;
44444452 }
44454453 // Find the closest Fiber store is aware of.
4446- let fiber = trackedPathMatchFiber;
4454+ let fiber: null | Fiber = trackedPathMatchFiber;
44474455 while (fiber !== null && shouldFilterFiber ( fiber ) ) {
44484456 fiber = fiber . return ;
44494457 }
0 commit comments