Merge pull request #6 from react-navigation/useRNScreens

Use react-native-screens when native screen components are available
This commit is contained in:
Brent Vatne 2018-09-11 15:14:11 +01:00 committed by GitHub
commit 36ccf5ba6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 21 deletions

View File

@ -33,6 +33,7 @@
}, },
"homepage": "https://github.com/react-navigation/react-navigation-stack#readme", "homepage": "https://github.com/react-navigation/react-navigation-stack#readme",
"dependencies": { "dependencies": {
"react-native-screens": "^1.0.0-alpha.8"
}, },
"devDependencies": { "devDependencies": {
"@expo/vector-icons": "^6.2.0", "@expo/vector-icons": "^6.2.0",

View File

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import { StyleSheet, Platform } from 'react-native'; import { StyleSheet, Platform } from 'react-native';
import { Screen } from './screens'; import { Screen } from 'react-native-screens';
import createPointerEventsContainer from './createPointerEventsContainer'; import createPointerEventsContainer from './createPointerEventsContainer';
const EPS = 1e-5; const EPS = 1e-5;

View File

@ -18,10 +18,10 @@ import {
withOrientation, withOrientation,
NavigationProvider, NavigationProvider,
} from 'react-navigation'; } from 'react-navigation';
import { ScreenContainer } from 'react-native-screens';
import Card from './StackViewCard'; import Card from './StackViewCard';
import Header from '../Header/Header'; import Header from '../Header/Header';
import { ScreenContainer } from './screens';
import TransitionConfigs from './StackViewTransitionConfigs'; import TransitionConfigs from './StackViewTransitionConfigs';
import { supportsImprovedSpringAnimation } from '../../utils/ReactNativeFeatures'; import { supportsImprovedSpringAnimation } from '../../utils/ReactNativeFeatures';

View File

@ -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 <Animated.View {...props} ref={onComponentRef} />;
}
}
export { ScreenContainer, Screen };

View File

@ -4981,6 +4981,10 @@ react-native-safe-area-view@^0.8.0:
dependencies: dependencies:
hoist-non-react-statics "^2.3.1" 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: react-native-tab-view@^0.0.77:
version "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" resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.77.tgz#11ceb8e7c23100d07e628dc151b57797524d00d4"