mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
add offscreen state node (#24026)
Add state node on Offscreen fibers with id (in preparation for transition tracing)
This commit is contained in:
@@ -15,7 +15,10 @@ import type {WorkTag} from './ReactWorkTags';
|
||||
import type {TypeOfMode} from './ReactTypeOfMode';
|
||||
import type {Lanes} from './ReactFiberLane.new';
|
||||
import type {SuspenseInstance, Props} from './ReactFiberHostConfig';
|
||||
import type {OffscreenProps} from './ReactFiberOffscreenComponent';
|
||||
import type {
|
||||
OffscreenProps,
|
||||
OffscreenInstance,
|
||||
} from './ReactFiberOffscreenComponent';
|
||||
|
||||
import {
|
||||
createRootStrictEffectsByDefault,
|
||||
@@ -735,6 +738,8 @@ export function createFiberFromOffscreen(
|
||||
const fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
|
||||
fiber.elementType = REACT_OFFSCREEN_TYPE;
|
||||
fiber.lanes = lanes;
|
||||
const primaryChildInstance: OffscreenInstance = {};
|
||||
fiber.stateNode = primaryChildInstance;
|
||||
return fiber;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,10 @@ import type {WorkTag} from './ReactWorkTags';
|
||||
import type {TypeOfMode} from './ReactTypeOfMode';
|
||||
import type {Lanes} from './ReactFiberLane.old';
|
||||
import type {SuspenseInstance, Props} from './ReactFiberHostConfig';
|
||||
import type {OffscreenProps} from './ReactFiberOffscreenComponent';
|
||||
import type {
|
||||
OffscreenProps,
|
||||
OffscreenInstance,
|
||||
} from './ReactFiberOffscreenComponent';
|
||||
|
||||
import {
|
||||
createRootStrictEffectsByDefault,
|
||||
@@ -735,6 +738,8 @@ export function createFiberFromOffscreen(
|
||||
const fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
|
||||
fiber.elementType = REACT_OFFSCREEN_TYPE;
|
||||
fiber.lanes = lanes;
|
||||
const primaryChildInstance: OffscreenInstance = {};
|
||||
fiber.stateNode = primaryChildInstance;
|
||||
return fiber;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,3 +31,5 @@ export type OffscreenState = {|
|
||||
baseLanes: Lanes,
|
||||
cachePool: SpawnedCachePool | null,
|
||||
|};
|
||||
|
||||
export type OffscreenInstance = {};
|
||||
|
||||
Reference in New Issue
Block a user