/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
v18.2.0
packages/react-reconciler/src/ReactFiberOffscreenComponent.js
43 строки
1 KB
Andrew Clark
Bugfix: Revealing a hidden update (#24685)
08 июн 2022, 03:04
Не верифицирован
08 июн 2022, 03:04
79f54c1
Код
Авторство
О чём код?
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import type {ReactNodeList, OffscreenMode} from 'shared/ReactTypes'; import type {Lanes} from './ReactFiberLane.old'; import type {SpawnedCachePool} from './ReactFiberCacheComponent.new'; import type {Transition} from './ReactFiberTracingMarkerComponent.new'; export type OffscreenProps = {| // TODO: Pick an API before exposing the Offscreen type. I've chosen an enum // for now, since we might have multiple variants. For example, hiding the // content without changing the layout. // // Default mode is visible. Kind of a weird default for a component // called "Offscreen." Possible alt: <Visibility />? mode?: OffscreenMode | null | void, children?: ReactNodeList, |}; // We use the existence of the state object as an indicator that the component // is hidden. export type OffscreenState = {| // TODO: This doesn't do anything, yet. It's always NoLanes. But eventually it // will represent the pending work that must be included in the render in // order to unhide the component. baseLanes: Lanes, cachePool: SpawnedCachePool | null, transitions: Set<Transition> | null, |}; export type OffscreenQueue = {| transitions: Array<Transition> | null, |} | null; export type OffscreenInstance = {| isHidden: boolean, |};