Stabilize RootTagContext
Summary: Changelog: [General][Added] - Stabilize RootTagContext. And temporarily export both `unstable_RootTagContext` and `RootTagContext` Reviewed By: TheSavior Differential Revision: D27951427 fbshipit-source-id: dff8d4ca07c89edeeb517a42a3922e4e23899d8e
This commit is contained in:
Родитель
8719a2e9a9
Коммит
9d489354ae
3
index.js
3
index.js
|
@ -482,6 +482,9 @@ module.exports = {
|
||||||
get unstable_RootTagContext(): RootTagContext {
|
get unstable_RootTagContext(): RootTagContext {
|
||||||
return require('./Libraries/ReactNative/RootTag').RootTagContext;
|
return require('./Libraries/ReactNative/RootTag').RootTagContext;
|
||||||
},
|
},
|
||||||
|
get RootTagContext(): RootTagContext {
|
||||||
|
return require('./Libraries/ReactNative/RootTag').RootTagContext;
|
||||||
|
},
|
||||||
get unstable_enableLogBox(): () => void {
|
get unstable_enableLogBox(): () => void {
|
||||||
return () =>
|
return () =>
|
||||||
console.warn(
|
console.warn(
|
||||||
|
|
|
@ -17,7 +17,7 @@ import {
|
||||||
FlatList,
|
FlatList,
|
||||||
Platform,
|
Platform,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
unstable_RootTagContext,
|
RootTagContext,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ type State = {|
|
||||||
|};
|
|};
|
||||||
|
|
||||||
class SampleTurboModuleExample extends React.Component<{||}, State> {
|
class SampleTurboModuleExample extends React.Component<{||}, State> {
|
||||||
static contextType: React$Context<RootTag> = unstable_RootTagContext;
|
static contextType: React$Context<RootTag> = RootTagContext;
|
||||||
|
|
||||||
state: State = {
|
state: State = {
|
||||||
testResults: {},
|
testResults: {},
|
||||||
|
|
Загрузка…
Ссылка в новой задаче