refactor: import from /native instead of /core

This commit is contained in:
Satyajit Sahoo
2019-12-11 17:22:59 +01:00
parent 7b8277dae5
commit eef17a801e
60 changed files with 66 additions and 66 deletions

View File

@@ -7,7 +7,7 @@ Stack navigator for React Navigation.
Open a Terminal in your project's folder and run,
```sh
yarn add @react-navigation/core @react-navigation/stack @react-native-community/masked-view
yarn add @react-navigation/native @react-navigation/stack @react-native-community/masked-view
```
Now we need to install [`react-native-gesture-handler`](https://github.com/kmagiera/react-native-gesture-handler), [`react-native-reanimated`](https://github.com/kmagiera/react-native-reanimated), [`react-native-screens`](https://github.com/kmagiera/react-native-screens) and [`react-native-safe-area-context`](https://github.com/th3rdwave/react-native-safe-area-context).

View File

@@ -51,7 +51,7 @@
},
"peerDependencies": {
"@react-native-community/masked-view": "^0.1.1",
"@react-navigation/core": "^5.0.0-alpha.0",
"@react-navigation/native": "^5.0.0-alpha.0",
"react": "*",
"react-native": "*",
"react-native-gesture-handler": "^1.0.0",

View File

@@ -4,7 +4,7 @@ import {
createNavigatorFactory,
DefaultNavigatorOptions,
EventArg,
} from '@react-navigation/core';
} from '@react-navigation/native';
import {
StackRouter,
StackRouterOptions,

View File

@@ -12,7 +12,7 @@ import {
Descriptor,
Route,
NavigationHelpers,
} from '@react-navigation/core';
} from '@react-navigation/native';
import { StackNavigationState } from '@react-navigation/routers';
export type StackNavigationEventMap = {

View File

@@ -4,7 +4,7 @@ import {
NavigationContext,
Route,
ParamListBase,
} from '@react-navigation/core';
} from '@react-navigation/native';
import { StackNavigationState } from '@react-navigation/routers';
import { EdgeInsets } from 'react-native-safe-area-context';

View File

@@ -8,7 +8,7 @@ import {
} from 'react-native';
import Animated from 'react-native-reanimated';
import { EdgeInsets } from 'react-native-safe-area-context';
import { Route } from '@react-navigation/core';
import { Route } from '@react-navigation/native';
import HeaderBackButton from './HeaderBackButton';
import HeaderBackground from './HeaderBackground';
import memoize from '../../utils/memoize';

View File

@@ -2,7 +2,7 @@ import * as React from 'react';
import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
import Animated from 'react-native-reanimated';
import { StackNavigationState } from '@react-navigation/routers';
import { Route } from '@react-navigation/core';
import { Route } from '@react-navigation/native';
import { Props as HeaderContainerProps } from '../Header/HeaderContainer';
import Card from './Card';
import { Scene, Layout, StackHeaderMode, TransitionPreset } from '../../types';

View File

@@ -11,7 +11,7 @@ import Animated from 'react-native-reanimated';
import { EdgeInsets } from 'react-native-safe-area-context';
// eslint-disable-next-line import/no-unresolved
import * as Screens from 'react-native-screens'; // Import with * as to prevent getters being called
import { Route } from '@react-navigation/core';
import { Route } from '@react-navigation/native';
import { StackNavigationState } from '@react-navigation/routers';
import { getDefaultHeaderHeight } from '../Header/HeaderSegment';

View File

@@ -1,7 +1,7 @@
import * as React from 'react';
import { Platform } from 'react-native';
import { SafeAreaConsumer, EdgeInsets } from 'react-native-safe-area-context';
import { Route } from '@react-navigation/core';
import { Route } from '@react-navigation/native';
import { StackActions, StackNavigationState } from '@react-navigation/routers';
import CardStack from './CardStack';