@@ -15,6 +15,7 @@ import type {SideEffectTag} from 'shared/ReactSideEffectTags';
15
15
import type { ExpirationTime } from './ReactFiberExpirationTime' ;
16
16
import type { UpdateQueue } from './ReactUpdateQueue' ;
17
17
import type { ContextDependencyList } from './ReactFiberNewContext' ;
18
+ import type { HookType } from './ReactFiberHooks' ;
18
19
19
20
import invariant from 'shared/invariant' ;
20
21
import warningWithoutStack from 'shared/warningWithoutStack' ;
@@ -204,6 +205,9 @@ export type Fiber = {|
204
205
_debugSource ? : Source | null ,
205
206
_debugOwner ? : Fiber | null ,
206
207
_debugIsCurrentlyTiming ? : boolean ,
208
+
209
+ // Used to verify that the order of hooks does not change between renders.
210
+ _debugHookTypes ?: Array < HookType > | null ,
207
211
| } ;
208
212
209
213
let debugCounter ;
@@ -285,6 +289,7 @@ function FiberNode(
285
289
this . _debugSource = null ;
286
290
this . _debugOwner = null ;
287
291
this . _debugIsCurrentlyTiming = false ;
292
+ this . _debugHookTypes = null ;
288
293
if ( ! hasBadMapPolyfill && typeof Object . preventExtensions === 'function' ) {
289
294
Object . preventExtensions ( this ) ;
290
295
}
@@ -370,6 +375,7 @@ export function createWorkInProgress(
370
375
workInProgress . _debugID = current . _debugID ;
371
376
workInProgress . _debugSource = current . _debugSource ;
372
377
workInProgress . _debugOwner = current . _debugOwner ;
378
+ workInProgress . _debugHookTypes = current . _debugHookTypes ;
373
379
}
374
380
375
381
workInProgress . alternate = current ;
@@ -723,5 +729,6 @@ export function assignFiberPropertiesInDEV(
723
729
target . _debugSource = source . _debugSource ;
724
730
target . _debugOwner = source . _debugOwner ;
725
731
target . _debugIsCurrentlyTiming = source . _debugIsCurrentlyTiming ;
732
+ target . _debugHookTypes = source . _debugHookTypes ;
726
733
return target ;
727
734
}
0 commit comments