mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 22:39:41 +08:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77aa514874 | ||
|
|
2733fab3ee | ||
|
|
ebc18aa859 | ||
|
|
a931aa3986 | ||
|
|
b54874969d | ||
|
|
ef0c8487b0 | ||
|
|
ea002fe950 | ||
|
|
41cf95941f | ||
|
|
884bde0338 | ||
|
|
31e07e9692 | ||
|
|
363f06d30e | ||
|
|
59c09a6040 | ||
|
|
c4b039cc19 | ||
|
|
49e3fb0d97 | ||
|
|
3367501d4d | ||
|
|
4fb6b163ac | ||
|
|
d0b4ba40e9 | ||
|
|
1be5c7ae35 | ||
|
|
bfa68ded1e | ||
|
|
2d3f159c2a | ||
|
|
e0fb642490 |
125
CHANGELOG.md
125
CHANGELOG.md
@@ -7,6 +7,113 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [3.2.3] - [2019-02-09](https://github.com/react-navigation/react-navigation/releases/tag/3.2.3)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- `await` the result of `onTransitionStart` before starting the transition (https://github.com/react-navigation/react-navigation-stack/pull/79)
|
||||||
|
|
||||||
|
## [3.2.2]
|
||||||
|
|
||||||
|
- Oops, I skipped it. Nothing here.
|
||||||
|
|
||||||
|
## [3.2.1] - [2019-02-09](https://github.com/react-navigation/react-navigation/releases/tag/3.2.1)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Remove accidental console.log
|
||||||
|
|
||||||
|
## [3.2.0] - [2019-02-08](https://github.com/react-navigation/react-navigation/releases/tag/3.2.0)
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Add support for `backBehavior: history'` and `backBehavior: 'order'` to any navigator based on SwitchRouter (eg: tab navigators). (https://github.com/react-navigation/react-navigation-core/pull/31)
|
||||||
|
|
||||||
|
## [3.1.5] - [2019-02-06](https://github.com/react-navigation/react-navigation/releases/tag/3.1.5)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Revert "Transparent header measurement fix (https://github.com/react-navigation/react-navigation-stack/pull/71)"
|
||||||
|
|
||||||
|
## [3.1.4] - [2019-02-05](https://github.com/react-navigation/react-navigation/releases/tag/3.1.4)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Fix references to onGestureFinish in StackViewLayout, should be onGestureEnd
|
||||||
|
|
||||||
|
## [3.1.3] - [2019-02-04](https://github.com/react-navigation/react-navigation/releases/tag/3.1.3)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Stack navigator properly dismisses and restores keyboard when gesture starts and is cancelled
|
||||||
|
- Transparent header measurement fix (https://github.com/react-navigation/react-navigation-stack/pull/71)
|
||||||
|
|
||||||
|
## [3.1.2] - [2019-02-01](https://github.com/react-navigation/react-navigation/releases/tag/3.1.2)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Update flow definition for `withNavigation` and `withNavigationFocus` to support `defaultProps`
|
||||||
|
- Prevent onRef callback be called twice on withNavigationFocus components (https://github.com/react-navigation/react-navigation-core/pull/30)
|
||||||
|
- Bump react-navigation-drawer version to improve performance - if you use Expo, you will need expo@^32.0.3 to update!
|
||||||
|
|
||||||
|
## [3.0.9] - [2018-12-19](https://github.com/react-navigation/react-navigation/releases/tag/3.0.9)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Intermittent flicker when changing tabs while using react-native-screens fixed by not changing opacity (https://github.com/react-navigation/react-navigation-tabs/pull/80)
|
||||||
|
- Prevent fading the previous screen on push/pop on Android (https://github.com/react-navigation/react-navigation-stack/pull/73)
|
||||||
|
|
||||||
|
## [3.0.8] - [2018-12-08](https://github.com/react-navigation/react-navigation/releases/tag/3.0.8)
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Lock create-react-context to 0.2.2
|
||||||
|
|
||||||
|
## [3.0.7] - [2018-12-08](https://github.com/react-navigation/react-navigation/releases/tag/3.0.7)
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Optimize stack gesture to avoid a setState and reduce unnecessary Animated node creation (https://github.com/react-navigation/react-navigation-stack/pull/70)
|
||||||
|
|
||||||
|
## [3.0.6] - [2018-12-06](https://github.com/react-navigation/react-navigation/releases/tag/3.0.6)
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fix drawer accessibility label when drawer label is not a string
|
||||||
|
|
||||||
|
|
||||||
|
## [3.0.5] - [2018-12-03](https://github.com/react-navigation/react-navigation/releases/tag/3.0.5)
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fix crash in rare case where onNavigationStateChange on container leads to setState and container has screenProps (https://github.com/react-navigation/react-navigation/issues/5301)
|
||||||
|
- Expose underlaying ScrollView methods to NavigationAwareScrollable (https://github.com/react-navigation/react-navigation-native/pull/8)
|
||||||
|
|
||||||
|
## [3.0.4] - [2018-11-30](https://github.com/react-navigation/react-navigation/releases/tag/3.0.4)
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Lock dependencies to exact versions
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fix crash when screenInterpolator is null (https://github.com/react-navigation/react-navigation-stack/issues/64)
|
||||||
|
- Fix renderPager override (https://github.com/react-navigation/react-navigation-tabs/pull/70)
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Accessibility labels on drawer items (https://github.com/react-navigation/react-navigation-drawer/pull/30)
|
||||||
|
|
||||||
|
|
||||||
|
## [3.0.3] - [2018-11-30](https://github.com/react-navigation/react-navigation/releases/tag/3.0.3)
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fix bug where if you navigate immediately when the navigator is first mounted the stack could get in an invalid state.
|
||||||
|
- Transparent stack card factors in header height now, even though you probably won't want to use this.
|
||||||
|
- Fix bug where shadow was still rendered on transparent stack
|
||||||
|
- Fix gestureResponseDistance custom values being ignored for modal stack
|
||||||
|
|
||||||
## [3.0.2] - [2018-11-27](https://github.com/react-navigation/react-navigation/releases/tag/3.0.2)
|
## [3.0.2] - [2018-11-27](https://github.com/react-navigation/react-navigation/releases/tag/3.0.2)
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
@@ -20,7 +127,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
- fix NavigationTestUtils.js deprecated file import.
|
- fix NavigationTestUtils.js deprecated file import.
|
||||||
- Update `getParam` flow typings to check `key` and `fallback` arguments, as well as return the correct type automatically.
|
- Update `getParam` flow typings to check `key` and `fallback` arguments, as well as return the correct type automatically.
|
||||||
- Fix regression in backgroundColor on cardStyle for stack navigator
|
- Fix regression in backgroundColor on cardStyle for stack navigator.
|
||||||
|
|
||||||
## [3.0.0] - [2018-11-17](https://github.com/react-navigation/react-navigation/releases/tag/3.0.0)
|
## [3.0.0] - [2018-11-17](https://github.com/react-navigation/react-navigation/releases/tag/3.0.0)
|
||||||
|
|
||||||
@@ -30,7 +137,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
- [2.x](https://github.com/react-navigation/react-navigation/blob/2.x/CHANGELOG.md)
|
- [2.x](https://github.com/react-navigation/react-navigation/blob/2.x/CHANGELOG.md)
|
||||||
|
|
||||||
[Unreleased]: https://github.com/react-navigation/react-navigation/compare/3.0.2...HEAD
|
[Unreleased]: https://github.com/react-navigation/react-navigation/compare/3.2.3...HEAD
|
||||||
|
[3.2.3]: https://github.com/react-navigation/react-navigation/compare/3.2.1...3.2.3
|
||||||
|
[3.2.1]: https://github.com/react-navigation/react-navigation/compare/3.2.0...3.2.1
|
||||||
|
[3.2.0]: https://github.com/react-navigation/react-navigation/compare/3.1.5...3.2.0
|
||||||
|
[3.1.5]: https://github.com/react-navigation/react-navigation/compare/3.1.4...3.1.5
|
||||||
|
[3.1.4]: https://github.com/react-navigation/react-navigation/compare/3.1.3...3.1.4
|
||||||
|
[3.1.3]: https://github.com/react-navigation/react-navigation/compare/3.1.2...3.1.3
|
||||||
|
[3.1.2]: https://github.com/react-navigation/react-navigation/compare/3.0.9...3.1.2
|
||||||
|
[3.0.9]: https://github.com/react-navigation/react-navigation/compare/3.0.8...3.0.9
|
||||||
|
[3.0.8]: https://github.com/react-navigation/react-navigation/compare/3.0.7...3.0.8
|
||||||
|
[3.0.7]: https://github.com/react-navigation/react-navigation/compare/3.0.6...3.0.7
|
||||||
|
[3.0.6]: https://github.com/react-navigation/react-navigation/compare/3.0.5...3.0.6
|
||||||
|
[3.0.5]: https://github.com/react-navigation/react-navigation/compare/3.0.4...3.0.5
|
||||||
|
[3.0.4]: https://github.com/react-navigation/react-navigation/compare/3.0.3...3.0.4
|
||||||
|
[3.0.3]: https://github.com/react-navigation/react-navigation/compare/3.0.2...3.0.3
|
||||||
[3.0.2]: https://github.com/react-navigation/react-navigation/compare/3.0.1...3.0.2
|
[3.0.2]: https://github.com/react-navigation/react-navigation/compare/3.0.1...3.0.2
|
||||||
[3.0.1]: https://github.com/react-navigation/react-navigation/compare/3.0.0...3.0.1
|
[3.0.1]: https://github.com/react-navigation/react-navigation/compare/3.0.0...3.0.1
|
||||||
[3.0.0]: https://github.com/react-navigation/react-navigation/compare/2.x...3.0.0
|
[3.0.0]: https://github.com/react-navigation/react-navigation/compare/2.x...3.0.0
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -6,17 +6,7 @@ React Navigation is born from the React Native community's need for an extensibl
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Since the library is a JS-based solution, to install the latest version of react-navigation you only need to run:
|
See: https://reactnavigation.org/docs/en/getting-started.html
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn add react-navigation
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install --save react-navigation
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,5 @@
|
|||||||
{
|
{
|
||||||
"presets": [
|
"presets": [
|
||||||
"babel-preset-expo"
|
"expo"
|
||||||
],
|
]
|
||||||
"env": {
|
|
||||||
"development": {
|
|
||||||
"plugins": [
|
|
||||||
"transform-react-jsx-source"
|
|
||||||
],
|
|
||||||
},
|
|
||||||
"production": {
|
|
||||||
"plugins": [
|
|
||||||
"transform-remove-console"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
# Navigation Playground Example
|
# Navigation Playground Example
|
||||||
|
|
||||||
A playground for experimenting with react-navigation in a pure-JS React Native app.
|
The NavigationPlayground example app includes a variety of patterns and is used as a simple way for contributors to manually integration test changes.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Please see the [Contributors Guide](https://reactnavigation.org/docs/contributing.html#run-the-example-app) for instructions on running these example apps.
|
```bash
|
||||||
|
yarn # in the react-navigation root directory
|
||||||
|
cd examples/NavigationPlayground
|
||||||
|
yarn
|
||||||
|
yarn start
|
||||||
|
```
|
||||||
|
|
||||||
You can view this example application directly on your phone by visiting [our expo demo](https://exp.host/@react-navigation/NavigationPlayground).
|
You can view this example application directly on Android phones by visiting scanning the QR code on [this site](https://exp.host/@react-navigation/NavigationPlayground) with the [Expo app](https://play.google.com/store/apps/details?id=host.exp.exponent&hl=en).
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"splash": {
|
"splash": {
|
||||||
"image": "./assets/icons/splash.png"
|
"image": "./assets/icons/splash.png"
|
||||||
},
|
},
|
||||||
"sdkVersion": "30.0.0",
|
"sdkVersion": "32.0.0",
|
||||||
"assetBundlePatterns": [
|
"assetBundlePatterns": [
|
||||||
"**/*"
|
"**/*"
|
||||||
],
|
],
|
||||||
@@ -23,4 +23,4 @@
|
|||||||
"package": "com.reactnavigation.example"
|
"package": "com.reactnavigation.example"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class MyHomeScreen extends React.Component {
|
|||||||
tabBarLabel: 'Home',
|
tabBarLabel: 'Home',
|
||||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-home' : 'ios-home-outline'}
|
name={focused ? 'ios-home' : 'ios-home'}
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -41,7 +41,7 @@ class ReccomendedScreen extends React.Component {
|
|||||||
tabBarLabel: 'Reccomended',
|
tabBarLabel: 'Reccomended',
|
||||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-people' : 'ios-people-outline'}
|
name={focused ? 'ios-people' : 'ios-people'}
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -67,7 +67,7 @@ class FeaturedScreen extends React.Component {
|
|||||||
tabBarLabel: 'Featured',
|
tabBarLabel: 'Featured',
|
||||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-star' : 'ios-star-outline'}
|
name={focused ? 'ios-star' : 'ios-star'}
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ MyHomeScreen.navigationOptions = {
|
|||||||
tabBarLabel: 'Home',
|
tabBarLabel: 'Home',
|
||||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-home' : 'ios-home-outline'}
|
name={'ios-home'}
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -94,7 +94,7 @@ class MyPeopleScreen extends React.Component<MyPeopleScreenProps> {
|
|||||||
tabBarLabel: 'People',
|
tabBarLabel: 'People',
|
||||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-people' : 'ios-people-outline'}
|
name={'ios-people'}
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -134,7 +134,7 @@ class MyChatScreen extends React.Component<MyChatScreenProps> {
|
|||||||
tabBarLabel: 'Chat',
|
tabBarLabel: 'Chat',
|
||||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-chatboxes' : 'ios-chatboxes-outline'}
|
name={'ios-chatboxes'}
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -169,7 +169,7 @@ MySettingsScreen.navigationOptions = {
|
|||||||
tabBarLabel: 'Settings',
|
tabBarLabel: 'Settings',
|
||||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-settings' : 'ios-settings-outline'}
|
name={'ios-settings'}
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -196,6 +196,7 @@ const SimpleTabs = createBottomTabNavigator(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
backBehavior: 'history',
|
||||||
tabBarOptions: {
|
tabBarOptions: {
|
||||||
activeTintColor: '#e91e63',
|
activeTintColor: '#e91e63',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ const StacksInTabs = createBottomTabNavigator(
|
|||||||
tabBarLabel: 'Home',
|
tabBarLabel: 'Home',
|
||||||
tabBarIcon: ({ tintColor, focused }) => (
|
tabBarIcon: ({ tintColor, focused }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-home' : 'ios-home-outline'}
|
name={focused ? 'ios-home' : 'ios-home'}
|
||||||
size={26}
|
size={26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -123,7 +123,7 @@ const StacksInTabs = createBottomTabNavigator(
|
|||||||
tabBarLabel: 'Settings',
|
tabBarLabel: 'Settings',
|
||||||
tabBarIcon: ({ tintColor, focused }) => (
|
tabBarIcon: ({ tintColor, focused }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-settings' : 'ios-settings-outline'}
|
name={focused ? 'ios-settings' : 'ios-settings'}
|
||||||
size={26}
|
size={26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const TabNav = createBottomTabNavigator(
|
|||||||
tabBarLabel: 'Home',
|
tabBarLabel: 'Home',
|
||||||
tabBarIcon: ({ tintColor, focused }) => (
|
tabBarIcon: ({ tintColor, focused }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-home' : 'ios-home-outline'}
|
name={focused ? 'ios-home' : 'ios-home'}
|
||||||
size={26}
|
size={26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -80,7 +80,7 @@ const TabNav = createBottomTabNavigator(
|
|||||||
title: 'Settings',
|
title: 'Settings',
|
||||||
tabBarIcon: ({ tintColor, focused }) => (
|
tabBarIcon: ({ tintColor, focused }) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={focused ? 'ios-settings' : 'ios-settings-outline'}
|
name={focused ? 'ios-settings' : 'ios-settings'}
|
||||||
size={26}
|
size={26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -105,15 +105,15 @@ const createTabScreen = (name, icon, focusedIcon) => {
|
|||||||
const TabsWithNavigationEvents = createMaterialBottomTabNavigator(
|
const TabsWithNavigationEvents = createMaterialBottomTabNavigator(
|
||||||
{
|
{
|
||||||
One: {
|
One: {
|
||||||
screen: createTabScreen('One', 'numeric-1-box-outline', 'numeric-1-box'),
|
screen: createTabScreen('One', 'numeric-1-box', 'numeric-1-box'),
|
||||||
},
|
},
|
||||||
Two: {
|
Two: {
|
||||||
screen: createTabScreen('Two', 'numeric-2-box-outline', 'numeric-2-box'),
|
screen: createTabScreen('Two', 'numeric-2-box', 'numeric-2-box'),
|
||||||
},
|
},
|
||||||
Three: {
|
Three: {
|
||||||
screen: createTabScreen(
|
screen: createTabScreen(
|
||||||
'Three',
|
'Three',
|
||||||
'numeric-3-box-outline',
|
'numeric-3-box',
|
||||||
'numeric-3-box'
|
'numeric-3-box'
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -81,15 +81,15 @@ const createTabScreen = (name, icon, focusedIcon, tintColor = '#673ab7') => {
|
|||||||
const TabsWithNavigationFocus = createMaterialBottomTabNavigator(
|
const TabsWithNavigationFocus = createMaterialBottomTabNavigator(
|
||||||
{
|
{
|
||||||
One: {
|
One: {
|
||||||
screen: createTabScreen('One', 'numeric-1-box-outline', 'numeric-1-box'),
|
screen: createTabScreen('One', 'numeric-1-box', 'numeric-1-box'),
|
||||||
},
|
},
|
||||||
Two: {
|
Two: {
|
||||||
screen: createTabScreen('Two', 'numeric-2-box-outline', 'numeric-2-box'),
|
screen: createTabScreen('Two', 'numeric-2-box', 'numeric-2-box'),
|
||||||
},
|
},
|
||||||
Three: {
|
Three: {
|
||||||
screen: createTabScreen(
|
screen: createTabScreen(
|
||||||
'Three',
|
'Three',
|
||||||
'numeric-3-box-outline',
|
'numeric-3-box',
|
||||||
'numeric-3-box'
|
'numeric-3-box'
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,21 +4,21 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"main": "node_modules/expo/AppEntry.js",
|
"main": "node_modules/expo/AppEntry.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "rm -rf node_modules/react-native-screens && rm -rf node_modules/react-native-gesture-handler",
|
"postinstall": "rm -rf node_modules/react-navigation/{.git,node_modules,examples}",
|
||||||
"start": "expo start",
|
"start": "expo start",
|
||||||
"android": "expo start --android",
|
"android": "expo start --android",
|
||||||
"ios": "expo start --ios",
|
"ios": "expo start --ios",
|
||||||
"test": "flow"
|
"test": "flow"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"expo": "^30.0.0",
|
"expo": "^32.0.0",
|
||||||
"hoist-non-react-statics": "^3.0.1",
|
"hoist-non-react-statics": "^3.0.1",
|
||||||
"invariant": "^2.2.4",
|
"invariant": "^2.2.4",
|
||||||
"react": "16.3.1",
|
"react": "16.5.0",
|
||||||
"react-native": "^0.55.0",
|
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
|
||||||
"react-native-iphone-x-helper": "^1.0.2",
|
"react-native-iphone-x-helper": "^1.0.2",
|
||||||
"react-native-paper": "^2.1.3",
|
"react-native-paper": "^2.1.3",
|
||||||
"react-navigation": "link:../..",
|
"react-navigation": "../..",
|
||||||
"react-navigation-header-buttons": "^0.0.4",
|
"react-navigation-header-buttons": "^0.0.4",
|
||||||
"react-navigation-material-bottom-tabs": "1.0.0"
|
"react-navigation-material-bottom-tabs": "1.0.0"
|
||||||
},
|
},
|
||||||
@@ -38,13 +38,6 @@
|
|||||||
"json",
|
"json",
|
||||||
"jsx",
|
"jsx",
|
||||||
"node"
|
"node"
|
||||||
],
|
|
||||||
"modulePathIgnorePatterns": [
|
|
||||||
"/node_modules/.*/react-native/",
|
|
||||||
"/node_modules/.*/react/"
|
|
||||||
],
|
|
||||||
"transformIgnorePatterns": [
|
|
||||||
"/node_modules/(?!react-native|react-navigation)/"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
/**
|
|
||||||
* @noflow
|
|
||||||
*/
|
|
||||||
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
const blacklist = require('metro/src/blacklist');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
getBlacklistRE() {
|
|
||||||
return blacklist([
|
|
||||||
/react\-navigation\/examples\/(?!NavigationPlayground).*/,
|
|
||||||
/react\-navigation\/node_modules\/react-native\/(.*)/,
|
|
||||||
/react\-navigation\/node_modules\/react\/(.*)/,
|
|
||||||
/react\-navigation\/node_modules\/react-native-paper\/(.*)/,
|
|
||||||
/react\-navigation\/node_modules\/@expo\/vector-icons\/(.*)/,
|
|
||||||
]);
|
|
||||||
},
|
|
||||||
extraNodeModules: getNodeModulesForDirectory(path.resolve('.')),
|
|
||||||
};
|
|
||||||
|
|
||||||
function getNodeModulesForDirectory(rootPath) {
|
|
||||||
const nodeModulePath = path.join(rootPath, 'node_modules');
|
|
||||||
const folders = fs.readdirSync(nodeModulePath);
|
|
||||||
return folders.reduce((modules, folderName) => {
|
|
||||||
const folderPath = path.join(nodeModulePath, folderName);
|
|
||||||
if (folderName.startsWith('@')) {
|
|
||||||
const scopedModuleFolders = fs.readdirSync(folderPath);
|
|
||||||
const scopedModules = scopedModuleFolders.reduce(
|
|
||||||
(scopedModules, scopedFolderName) => {
|
|
||||||
scopedModules[
|
|
||||||
`${folderName}/${scopedFolderName}`
|
|
||||||
] = maybeResolveSymlink(path.join(folderPath, scopedFolderName));
|
|
||||||
return scopedModules;
|
|
||||||
},
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
return Object.assign({}, modules, scopedModules);
|
|
||||||
}
|
|
||||||
modules[folderName] = maybeResolveSymlink(folderPath);
|
|
||||||
return modules;
|
|
||||||
}, {});
|
|
||||||
}
|
|
||||||
|
|
||||||
function maybeResolveSymlink(maybeSymlinkPath) {
|
|
||||||
if (fs.lstatSync(maybeSymlinkPath).isSymbolicLink()) {
|
|
||||||
const resolved = path.resolve(
|
|
||||||
path.dirname(maybeSymlinkPath),
|
|
||||||
fs.readlinkSync(maybeSymlinkPath)
|
|
||||||
);
|
|
||||||
return resolved;
|
|
||||||
}
|
|
||||||
return maybeSymlinkPath;
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +0,0 @@
|
|||||||
# Examples
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Please see the [Contributors Guide](https://reactnavigation.org/docs/en/contributing.html#run-the-example-app) for instructions.
|
|
||||||
16
flow/react-navigation.js
vendored
16
flow/react-navigation.js
vendored
@@ -678,8 +678,8 @@ declare module 'react-navigation' {
|
|||||||
// The value that represents the progress of the transition when navigation
|
// The value that represents the progress of the transition when navigation
|
||||||
// state changes from one to another. Its numeric value will range from 0
|
// state changes from one to another. Its numeric value will range from 0
|
||||||
// to 1.
|
// to 1.
|
||||||
// progress.__getAnimatedValue() < 1 : transtion is happening.
|
// progress.__getAnimatedValue() < 1 : transition is happening.
|
||||||
// progress.__getAnimatedValue() == 1 : transtion completes.
|
// progress.__getAnimatedValue() == 1 : transition completes.
|
||||||
progress: AnimatedValue,
|
progress: AnimatedValue,
|
||||||
|
|
||||||
// All the scenes of the transitioner.
|
// All the scenes of the transitioner.
|
||||||
@@ -1208,19 +1208,19 @@ declare module 'react-navigation' {
|
|||||||
};
|
};
|
||||||
declare export var TabBarBottom: React$ComponentType<_TabBarBottomProps>;
|
declare export var TabBarBottom: React$ComponentType<_TabBarBottomProps>;
|
||||||
|
|
||||||
declare export function withNavigation<Props: {}>(
|
declare export function withNavigation<Props: {}, ComponentType: React$ComponentType<Props>>(
|
||||||
Component: React$ComponentType<Props>
|
Component: ComponentType
|
||||||
): React$ComponentType<
|
): React$ComponentType<
|
||||||
$Diff<
|
$Diff<
|
||||||
Props,
|
React$ElementConfig<ComponentType>,
|
||||||
{
|
{
|
||||||
navigation: NavigationScreenProp<NavigationStateRoute> | void,
|
navigation: NavigationScreenProp<NavigationStateRoute> | void,
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
>;
|
>;
|
||||||
declare export function withNavigationFocus<Props: {}>(
|
declare export function withNavigationFocus<Props: {}, ComponentType: React$ComponentType<Props>>(
|
||||||
Component: React$ComponentType<Props>
|
Component: ComponentType
|
||||||
): React$ComponentType<$Diff<Props, { isFocused: boolean | void }>>;
|
): React$ComponentType<$Diff<React$ElementConfig<ComponentType>, { isFocused: boolean | void }>>;
|
||||||
|
|
||||||
declare export function getNavigation<State: NavigationState, Options: {}>(
|
declare export function getNavigation<State: NavigationState, Options: {}>(
|
||||||
router: NavigationRouter<State, Options>,
|
router: NavigationRouter<State, Options>,
|
||||||
|
|||||||
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-navigation",
|
"name": "react-navigation",
|
||||||
"version": "3.0.2",
|
"version": "3.2.3",
|
||||||
"description": "Routing and navigation for your React Native apps",
|
"description": "Routing and navigation for your React Native apps",
|
||||||
"main": "src/react-navigation.js",
|
"main": "src/react-navigation.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -34,11 +34,11 @@
|
|||||||
"react-native": "*"
|
"react-native": "*"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-navigation/core": "^3.0.0",
|
"@react-navigation/core": "3.1.1",
|
||||||
"@react-navigation/native": "^3.0.1",
|
"@react-navigation/native": "3.1.4",
|
||||||
"react-navigation-drawer": "^1.0.3",
|
"react-navigation-drawer": "1.1.0",
|
||||||
"react-navigation-stack": "^1.0.2",
|
"react-navigation-stack": "1.0.10",
|
||||||
"react-navigation-tabs": "^1.0.0"
|
"react-navigation-tabs": "1.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-cli": "^6.24.1",
|
"babel-cli": "^6.24.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user