diff --git a/packages/stack/package.json b/packages/stack/package.json index 8f16f818..8edbd1a1 100644 --- a/packages/stack/package.json +++ b/packages/stack/package.json @@ -33,6 +33,7 @@ }, "homepage": "https://github.com/react-navigation/react-navigation-stack#readme", "dependencies": { + "react-native-screens": "^1.0.0-alpha.8" }, "devDependencies": { "@expo/vector-icons": "^6.2.0", diff --git a/packages/stack/src/views/StackView/StackViewCard.js b/packages/stack/src/views/StackView/StackViewCard.js index ba4098f7..c21239ba 100644 --- a/packages/stack/src/views/StackView/StackViewCard.js +++ b/packages/stack/src/views/StackView/StackViewCard.js @@ -1,6 +1,6 @@ import React from 'react'; import { StyleSheet, Platform } from 'react-native'; -import { Screen } from './screens'; +import { Screen } from 'react-native-screens'; import createPointerEventsContainer from './createPointerEventsContainer'; const EPS = 1e-5; diff --git a/packages/stack/src/views/StackView/StackViewLayout.js b/packages/stack/src/views/StackView/StackViewLayout.js index f9716e2b..af16a5f0 100644 --- a/packages/stack/src/views/StackView/StackViewLayout.js +++ b/packages/stack/src/views/StackView/StackViewLayout.js @@ -18,10 +18,10 @@ import { withOrientation, NavigationProvider, } from 'react-navigation'; +import { ScreenContainer } from 'react-native-screens'; import Card from './StackViewCard'; import Header from '../Header/Header'; -import { ScreenContainer } from './screens'; import TransitionConfigs from './StackViewTransitionConfigs'; import { supportsImprovedSpringAnimation } from '../../utils/ReactNativeFeatures'; diff --git a/packages/stack/src/views/StackView/screens.js b/packages/stack/src/views/StackView/screens.js deleted file mode 100644 index 914f2150..00000000 --- a/packages/stack/src/views/StackView/screens.js +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import { Animated, View } from 'react-native'; - -const ScreenContainer = View; - -class Screen extends React.Component { - render() { - // Filter out active prop in this case because it is unused and - // can cause problems depending on react-native version: - // https://github.com/react-navigation/react-navigation/issues/4886 - - /* eslint-disable no-unused-vars */ - const { active, onComponentRef, ...props } = this.props; - - return ; - } -} - -export { ScreenContainer, Screen }; diff --git a/packages/stack/yarn.lock b/packages/stack/yarn.lock index ae2a0a2c..63e1cdc3 100644 --- a/packages/stack/yarn.lock +++ b/packages/stack/yarn.lock @@ -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.8: + version "1.0.0-alpha.8" + resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.8.tgz#c70b2d753420b9b9a64c4354bb301628f3a7d580" + 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"