Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Commit

Permalink
fix: add peer dep on react-navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Sep 9, 2019
1 parent 5b2f608 commit 664b01c
Show file tree
Hide file tree
Showing 14 changed files with 198 additions and 327 deletions.
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
"env": {
"es6": true,
"react-native-globals/all": true,
},

"rules": {
"import/named": "off"
}
}
8 changes: 6 additions & 2 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import {
Assets as StackAssets,
createStackNavigator,
} from 'react-navigation-stack';
import { Themed, createAppContainer } from '@react-navigation/native';
import { ThemeColors, useTheme } from '@react-navigation/core';
import {
Themed,
createAppContainer,
ThemeColors,
useTheme,
} from 'react-navigation';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import { Asset } from 'expo-asset';

Expand Down
3 changes: 1 addition & 2 deletions example/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ module.exports = {
providesModuleNodeModules: [
'@expo/vector-icons',
'@babel/runtime',
'@react-navigation/core',
'@react-navigation/native',
'react-navigation',
...dependencies,
...peerDependencies,
],
Expand Down
7 changes: 4 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
"main": "App.js",
"dependencies": {
"@expo/vector-icons": "^10.0.0",
"@react-navigation/core": "3.5.0",
"@react-navigation/native": "^3.6.2",
"expo": "^33.0.7",
"expo-asset": "^6.0.0",
"expo-constants": "~5.0.1",
"react": "16.8.3",
"react-navigation": "^4.0.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
"react-native-safe-area-view": "^0.13.1",
"react-native-safe-area-view": "0.13.1",
"react-native-screens": "1.0.0-alpha.22",
"react-native-tab-view": "^2.10.0",
"react-navigation-stack": "1.5.3"
Expand All @@ -28,6 +27,8 @@
"glob-to-regexp": "^0.4.0"
},
"resolutions": {
"**/react-native-screens": "1.0.0-alpha.22",
"**/react-native-safe-area-view": "0.13.1",
"**/hoist-non-react-statics": "2.5.0",
"**/react-native-tab-view": "2.10.0",
"**/prop-types": "15.6.1"
Expand Down
2 changes: 1 addition & 1 deletion example/src/Shared/PhotoGrid.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { View, Image, ScrollView, Dimensions, StyleSheet } from 'react-native';
import { withNavigation } from '@react-navigation/core';
import { withNavigation } from 'react-navigation';

@withNavigation
class NavigationAwareScrollView extends React.Component {
Expand Down
249 changes: 115 additions & 134 deletions example/yarn.lock

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,16 @@
"react": "16.5.0",
"react-dom": "16.5.0",
"react-native": "~0.57.1",
"react-native-reanimated": "^1.0.0-alpha.12",
"react-navigation": "^3.3.2",
"react-native-gesture-handler": "^1.4.1",
"react-native-reanimated": "^1.2.0",
"react-navigation": "^4.0.1",
"react-test-renderer": "16.5.0",
"release-it": "^10.3.1",
"typescript": "^3.5.2"
},
"peerDependencies": {
"@react-navigation/core": "^3.4.0",
"react": "*",
"react-navigation": "^4.0.1",
"react-native": "*",
"react-native-gesture-handler": "^1.0.0",
"react-native-reanimated": "^1.0.0-alpha",
Expand Down
2 changes: 1 addition & 1 deletion src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export type NavigationProp<RouteName = string, Params = object> = {
state: NavigationState;
setParams(params: Params): void;
getParam(): Params;
dispatch(action: { type: string }): void;
dispatch(action: { type: string }): boolean;
dangerouslyGetParent(): NavigationProp | undefined;
};

Expand Down
5 changes: 4 additions & 1 deletion src/utils/createTabNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
SceneView,
createNavigator,
SwitchActions,
} from '@react-navigation/core';
} from 'react-navigation';
import {
NavigationProp,
SceneDescriptor,
Expand Down Expand Up @@ -255,6 +255,9 @@ export default function createTabNavigator<

return (routes: RouteConfig<Options>, config: Partial<Options> = {}) => {
const router = TabRouter(routes, config as any);

// TODO: don't have time to fix it right now
// @ts-ignore
return createNavigator(NavigationView, router, config as any);
};
}
2 changes: 1 addition & 1 deletion src/views/BottomTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
LayoutChangeEvent,
} from 'react-native';
import SafeAreaView from 'react-native-safe-area-view';
import { ThemeColors, ThemeContext } from '@react-navigation/core';
import { ThemeColors, ThemeContext } from 'react-navigation';

import CrossFadeIcon from './CrossFadeIcon';
import withDimensions from '../utils/withDimensions';
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext"
}
Expand Down
58 changes: 0 additions & 58 deletions types/@react-navigation/core.d.ts

This file was deleted.

32 changes: 0 additions & 32 deletions types/@react-navigation/native.d.ts

This file was deleted.

Loading

0 comments on commit 664b01c

Please sign in to comment.