Add react-native-screens as dependency
This commit is contained in:
parent
45fa2b0e48
commit
7bae3b2499
|
@ -33,6 +33,7 @@
|
|||
},
|
||||
"homepage": "https://github.com/react-navigation/react-navigation-stack#readme",
|
||||
"dependencies": {
|
||||
"react-native-screens": "^1.0.0-alpha.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@expo/vector-icons": "^6.2.0",
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import React from 'react';
|
||||
import { Animated, View, UIManager, StyleSheet } from 'react-native';
|
||||
import {
|
||||
ScreenContainer as NativeScreenContainer,
|
||||
Screen as NativeScreen,
|
||||
} from 'react-native-screens';
|
||||
|
||||
class ScreenComponent extends React.Component {
|
||||
render() {
|
||||
|
@ -24,9 +28,6 @@ let Screen = ScreenComponent;
|
|||
// is linked natively (we only `require` the lib if native components are installed)
|
||||
if (UIManager['RNSScreen']) {
|
||||
// native screen components are available
|
||||
const screens = require('react-native-screens');
|
||||
|
||||
const NativeScreen = screens.Screen;
|
||||
class WrappedNativeScreen extends React.Component {
|
||||
setNativeProps(props) {
|
||||
this._ref.setNativeProps(props);
|
||||
|
@ -52,7 +53,7 @@ if (UIManager['RNSScreen']) {
|
|||
}
|
||||
|
||||
Screen = WrappedNativeScreen;
|
||||
ScreenContainer = screens.ScreenContainer;
|
||||
ScreenContainer = NativeScreenContainer;
|
||||
}
|
||||
|
||||
export { ScreenContainer, Screen };
|
||||
|
|
|
@ -4981,6 +4981,10 @@ react-native-safe-area-view@^0.8.0:
|
|||
dependencies:
|
||||
hoist-non-react-statics "^2.3.1"
|
||||
|
||||
react-native-screens@^1.0.0-alpha.3:
|
||||
version "1.0.0-alpha.3"
|
||||
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.3.tgz#22180cf91b4bc797428cde0d01b9b29809f82077"
|
||||
|
||||
react-native-tab-view@^0.0.77:
|
||||
version "0.0.77"
|
||||
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.77.tgz#11ceb8e7c23100d07e628dc151b57797524d00d4"
|
||||
|
|
Loading…
Reference in New Issue