mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
a850d116dc
Summary: Creates a `RootTag` type and refactors the `RootTagContext` module a bit. This creates space for eventually changing `RootTag` into an opaque type that is only created once by `AppContainer`, and only consumed by native abstractions. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21127173 fbshipit-source-id: 60177a6e5e02d6308e87f76d12a271114f8f8fe0
28 lines
565 B
JavaScript
28 lines
565 B
JavaScript
/**
|
|
* 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 strict
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import * as React from 'react';
|
|
|
|
// TODO: Make this into an opaque type.
|
|
export type RootTag = number;
|
|
|
|
export const RootTagContext: React$Context<RootTag> = React.createContext<RootTag>(
|
|
0,
|
|
);
|
|
|
|
/**
|
|
* Intended to only be used by `AppContainer`.
|
|
*/
|
|
export function createRootTag(rootTag: number): RootTag {
|
|
return rootTag;
|
|
}
|