mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-10 22:47:02 +08:00
rename to createAppContainer, other deprecations
- rename createNavigationContainer to createAppContainer - deprecate Transitioner import - clean up old deprecated exports without create prefix - rearrange
This commit is contained in:
@@ -30,8 +30,8 @@
|
||||
"react-native": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/core": "^3.0.0-alpha.2",
|
||||
"@react-navigation/native": "^3.0.0-alpha.2",
|
||||
"@react-navigation/core": "^3.0.0-alpha.4",
|
||||
"@react-navigation/native": "^3.0.0-alpha.3",
|
||||
"react-lifecycles-compat": "^3",
|
||||
"react-native-gesture-handler": "^1.0.0",
|
||||
"react-native-safe-area-view": "0.11.0",
|
||||
|
||||
184
packages/react-navigation/src/react-navigation.js
vendored
184
packages/react-navigation/src/react-navigation.js
vendored
@@ -1,100 +1,54 @@
|
||||
/* eslint global-require: 0 */
|
||||
|
||||
module.exports = {
|
||||
// Core
|
||||
// Native
|
||||
get createAppContainer() {
|
||||
return require('@react-navigation/native').createAppContainer;
|
||||
},
|
||||
get createNavigationContainer() {
|
||||
return require('@react-navigation/native').createNavigationContainer;
|
||||
console.warn(
|
||||
'`createNavigationContainer()` has been deprecated, please use `createAppContainer()` instead. You can also import createAppContainer directly from @react-navigation/native'
|
||||
);
|
||||
return require('@react-navigation/native').createAppContainer;
|
||||
},
|
||||
get createKeyboardAwareNavigator() {
|
||||
return require('@react-navigation/native').createKeyboardAwareNavigator;
|
||||
},
|
||||
get ResourceSavingSceneView() {
|
||||
return require('@react-navigation/native').ResourceSavingSceneView;
|
||||
},
|
||||
get withOrientation() {
|
||||
return require('@react-navigation/native').withOrientation;
|
||||
},
|
||||
|
||||
// Core
|
||||
get createNavigator() {
|
||||
return require('@react-navigation/core').createNavigator;
|
||||
},
|
||||
get StateUtils() {
|
||||
return require('@react-navigation/core').StateUtils;
|
||||
},
|
||||
get getNavigation() {
|
||||
return require('@react-navigation/core').getNavigation;
|
||||
},
|
||||
|
||||
// Navigators
|
||||
get createNavigator() {
|
||||
return require('@react-navigation/core').createNavigator;
|
||||
},
|
||||
get createKeyboardAwareNavigator() {
|
||||
return require('@react-navigation/native').createKeyboardAwareNavigator;
|
||||
},
|
||||
get NavigationProvider() {
|
||||
return require('@react-navigation/core').NavigationProvider;
|
||||
},
|
||||
get NavigationConsumer() {
|
||||
return require('@react-navigation/core').NavigationConsumer;
|
||||
},
|
||||
get createStackNavigator() {
|
||||
return require('react-navigation-stack').createStackNavigator;
|
||||
},
|
||||
get StackNavigator() {
|
||||
console.warn(
|
||||
'The StackNavigator function name is deprecated, please use createStackNavigator instead'
|
||||
);
|
||||
return require('react-navigation-stack').createStackNavigator;
|
||||
},
|
||||
get createSwitchNavigator() {
|
||||
return require('./navigators/createContainedSwitchNavigator').default;
|
||||
},
|
||||
get SwitchNavigator() {
|
||||
console.warn(
|
||||
'The SwitchNavigator function name is deprecated, please use createSwitchNavigator instead'
|
||||
);
|
||||
return require('./navigators/createContainedSwitchNavigator').default;
|
||||
},
|
||||
get createDrawerNavigator() {
|
||||
return require('react-navigation-drawer').createDrawerNavigator;
|
||||
},
|
||||
get DrawerNavigator() {
|
||||
console.warn(
|
||||
'The DrawerNavigator function name is deprecated, please use createDrawerNavigator instead'
|
||||
);
|
||||
return require('react-navigation-drawer').createDrawerNavigator;
|
||||
},
|
||||
get createTabNavigator() {
|
||||
console.warn(
|
||||
'createTabNavigator is deprecated. Please use the createBottomTabNavigator or createMaterialTopTabNavigator instead.'
|
||||
);
|
||||
return require('react-navigation-deprecated-tab-navigator')
|
||||
.createTabNavigator;
|
||||
},
|
||||
get TabNavigator() {
|
||||
console.warn(
|
||||
'TabNavigator is deprecated. Please use the createBottomTabNavigator or createMaterialTopTabNavigator instead.'
|
||||
);
|
||||
return require('react-navigation-deprecated-tab-navigator')
|
||||
.createTabNavigator;
|
||||
},
|
||||
get createBottomTabNavigator() {
|
||||
return require('react-navigation-tabs').createBottomTabNavigator;
|
||||
},
|
||||
get createMaterialTopTabNavigator() {
|
||||
return require('react-navigation-tabs').createMaterialTopTabNavigator;
|
||||
},
|
||||
|
||||
// Actions
|
||||
get NavigationActions() {
|
||||
return require('@react-navigation/core').NavigationActions;
|
||||
},
|
||||
get StackActions() {
|
||||
return require('@react-navigation/core').StackActions;
|
||||
},
|
||||
get DrawerActions() {
|
||||
return require('react-navigation-drawer').DrawerActions;
|
||||
},
|
||||
|
||||
// Routers
|
||||
get StackRouter() {
|
||||
return require('@react-navigation/core').StackRouter;
|
||||
},
|
||||
get TabRouter() {
|
||||
return require('@react-navigation/core').TabRouter;
|
||||
},
|
||||
get DrawerRouter() {
|
||||
return require('react-navigation-drawer').DrawerRouter;
|
||||
},
|
||||
get SwitchRouter() {
|
||||
return require('@react-navigation/core').SwitchRouter;
|
||||
},
|
||||
@@ -107,17 +61,62 @@ module.exports = {
|
||||
get validateRouteConfigMap() {
|
||||
return require('@react-navigation/core').validateRouteConfigMap;
|
||||
},
|
||||
|
||||
// Utils
|
||||
get getActiveChildNavigationOptions() {
|
||||
return require('@react-navigation/core').getActiveChildNavigationOptions;
|
||||
},
|
||||
get pathUtils() {
|
||||
return require('@react-navigation/core').pathUtils;
|
||||
},
|
||||
get SceneView() {
|
||||
return require('@react-navigation/core').SceneView;
|
||||
},
|
||||
get SwitchView() {
|
||||
return require('@react-navigation/core').SwitchView;
|
||||
},
|
||||
get NavigationEvents() {
|
||||
return require('@react-navigation/core').NavigationEvents;
|
||||
},
|
||||
get withNavigation() {
|
||||
return require('@react-navigation/core').withNavigation;
|
||||
},
|
||||
get withNavigationFocus() {
|
||||
return require('@react-navigation/core').withNavigationFocus;
|
||||
},
|
||||
|
||||
// Navigators
|
||||
|
||||
get createStackNavigator() {
|
||||
return require('react-navigation-stack').createStackNavigator;
|
||||
},
|
||||
get createSwitchNavigator() {
|
||||
return require('@react-navigation/core').createSwitchNavigator;
|
||||
},
|
||||
|
||||
get createBottomTabNavigator() {
|
||||
return require('react-navigation-tabs').createBottomTabNavigator;
|
||||
},
|
||||
get createMaterialTopTabNavigator() {
|
||||
return require('react-navigation-tabs').createMaterialTopTabNavigator;
|
||||
},
|
||||
|
||||
get createDrawerNavigator() {
|
||||
return require('react-navigation-drawer').createDrawerNavigator;
|
||||
},
|
||||
|
||||
// Routers and Actions
|
||||
|
||||
get DrawerRouter() {
|
||||
return require('react-navigation-drawer').DrawerRouter;
|
||||
},
|
||||
get DrawerActions() {
|
||||
return require('react-navigation-drawer').DrawerActions;
|
||||
},
|
||||
|
||||
// Views
|
||||
get Transitioner() {
|
||||
console.warn(
|
||||
'Importing the stack Transitioner directly from react-navigation is now deprecated. Instead, import { Transitioner } from "react-navigation-stack";'
|
||||
);
|
||||
return require('react-navigation-stack').Transitioner;
|
||||
},
|
||||
get StackView() {
|
||||
@@ -132,12 +131,6 @@ module.exports = {
|
||||
get SafeAreaView() {
|
||||
return require('react-native-safe-area-view').default;
|
||||
},
|
||||
get SceneView() {
|
||||
return require('@react-navigation/core').SceneView;
|
||||
},
|
||||
get ResourceSavingSceneView() {
|
||||
return require('@react-navigation/native').ResourceSavingSceneView;
|
||||
},
|
||||
|
||||
// Header
|
||||
get Header() {
|
||||
@@ -163,45 +156,4 @@ module.exports = {
|
||||
get DrawerSidebar() {
|
||||
return require('react-navigation-drawer').DrawerSidebar;
|
||||
},
|
||||
|
||||
// TabView
|
||||
get TabView() {
|
||||
console.warn(
|
||||
'TabView is deprecated. Please use the react-navigation-tabs package instead: https://github.com/react-navigation/react-navigation-tabs'
|
||||
);
|
||||
return require('react-navigation-deprecated-tab-navigator').TabView;
|
||||
},
|
||||
get TabBarTop() {
|
||||
console.warn(
|
||||
'TabBarTop is deprecated. Please use the react-navigation-tabs package instead: https://github.com/react-navigation/react-navigation-tabs'
|
||||
);
|
||||
return require('react-navigation-deprecated-tab-navigator').TabBarTop;
|
||||
},
|
||||
get TabBarBottom() {
|
||||
console.warn(
|
||||
'TabBarBottom is deprecated. Please use the react-navigation-tabs package instead: https://github.com/react-navigation/react-navigation-tabs'
|
||||
);
|
||||
return require('react-navigation-deprecated-tab-navigator').TabBarBottom;
|
||||
},
|
||||
|
||||
// SwitchView
|
||||
get SwitchView() {
|
||||
return require('@react-navigation/core').SwitchView;
|
||||
},
|
||||
|
||||
// NavigationEvents
|
||||
get NavigationEvents() {
|
||||
return require('@react-navigation/core').NavigationEvents;
|
||||
},
|
||||
|
||||
// HOCs
|
||||
get withNavigation() {
|
||||
return require('@react-navigation/core').withNavigation;
|
||||
},
|
||||
get withNavigationFocus() {
|
||||
return require('@react-navigation/core').withNavigationFocus;
|
||||
},
|
||||
get withOrientation() {
|
||||
return require('@react-navigation/native').withOrientation;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -18,16 +18,6 @@
|
||||
esutils "^2.0.2"
|
||||
js-tokens "^4.0.0"
|
||||
|
||||
"@react-navigation/core@^3.0.0-alpha.2":
|
||||
version "3.0.0-alpha.2"
|
||||
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-3.0.0-alpha.2.tgz#a47de58078ae1178cf37aeaac2512d78a0907451"
|
||||
integrity sha512-8tkJhxFJCrAujPZNPsfnkj16E2L8KTZNH89Z9hF+zNIebYGfWphLBzx/xbdNk8nC9SFstBppj1k/KJE6ilaSmA==
|
||||
dependencies:
|
||||
create-react-context "^0.2.3"
|
||||
hoist-non-react-statics "^3.0.1"
|
||||
path-to-regexp "^2.4.0"
|
||||
query-string "^6.2.0"
|
||||
|
||||
"@react-navigation/core@^3.0.0-alpha.4":
|
||||
version "3.0.0-alpha.4"
|
||||
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-3.0.0-alpha.4.tgz#0167a8352e867ebd09e444aac42b315f569fb81d"
|
||||
@@ -38,10 +28,10 @@
|
||||
path-to-regexp "^2.4.0"
|
||||
query-string "^6.2.0"
|
||||
|
||||
"@react-navigation/native@^3.0.0-alpha.2":
|
||||
version "3.0.0-alpha.2"
|
||||
resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-3.0.0-alpha.2.tgz#c483a54ddb82768c0c2c6923a8007ac9c924b92d"
|
||||
integrity sha512-6bPR+g15gJQo5bER4oJ4lxTs0hk0rZOnrgMwI+MflAqlRwqUBseRHiBr5tvfssrkTu3Q2GqZ0eSucc6WQDBU/A==
|
||||
"@react-navigation/native@^3.0.0-alpha.3":
|
||||
version "3.0.0-alpha.3"
|
||||
resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-3.0.0-alpha.3.tgz#7fd8d26b158040f456b4fd67a2b098e88f1fe7c9"
|
||||
integrity sha512-Vk1HhBxYFYHMdYVpdJXVZrH2LkjJ/Sv7XRbuOvRY40HdLkiGc+xLk5KattJKV0CgydP5Kh7rq8lZSN/HR4IwBQ==
|
||||
dependencies:
|
||||
"@react-navigation/core" "^3.0.0-alpha.4"
|
||||
hoist-non-react-statics "^3.0.1"
|
||||
|
||||
Reference in New Issue
Block a user