mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-15 22:35:20 +08:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac04aad700 | ||
|
|
b7fb44850d | ||
|
|
d3040e52b3 | ||
|
|
9e36d3e4c9 | ||
|
|
e64d1f6b57 | ||
|
|
77aa514874 | ||
|
|
2733fab3ee | ||
|
|
ebc18aa859 | ||
|
|
a931aa3986 | ||
|
|
b54874969d | ||
|
|
ef0c8487b0 | ||
|
|
ea002fe950 | ||
|
|
41cf95941f | ||
|
|
884bde0338 | ||
|
|
31e07e9692 | ||
|
|
363f06d30e | ||
|
|
59c09a6040 | ||
|
|
c4b039cc19 | ||
|
|
49e3fb0d97 | ||
|
|
3367501d4d | ||
|
|
4fb6b163ac | ||
|
|
d0b4ba40e9 | ||
|
|
1be5c7ae35 | ||
|
|
bfa68ded1e | ||
|
|
2d3f159c2a | ||
|
|
e0fb642490 |
@@ -16,25 +16,25 @@ jobs:
|
||||
- run: yarn # install root deps
|
||||
- run: ./scripts/test.sh # run tests
|
||||
- setup_remote_docker
|
||||
- deploy:
|
||||
command: |
|
||||
set -x
|
||||
VER="17.03.0-ce"
|
||||
curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
|
||||
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
|
||||
mv /tmp/docker/* /usr/bin
|
||||
|
||||
yarn global add exp
|
||||
set +x
|
||||
exp login -u "$EXPO_USERNAME" -p "$EXPO_PASSWORD"
|
||||
set -x
|
||||
cd examples/NavigationPlayground && yarn && exp publish --release-channel "${CIRCLE_SHA1}"
|
||||
# - deploy:
|
||||
# command: |
|
||||
# set -x
|
||||
# VER="17.03.0-ce"
|
||||
# curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
|
||||
# tar -xz -C /tmp -f /tmp/docker-$VER.tgz
|
||||
# mv /tmp/docker/* /usr/bin
|
||||
#
|
||||
# yarn global add exp
|
||||
# set +x
|
||||
# exp login -u "$EXPO_USERNAME" -p "$EXPO_PASSWORD"
|
||||
# set -x
|
||||
# cd examples/NavigationPlayground && yarn && exp publish --release-channel "${CIRCLE_SHA1}"
|
||||
- save_cache:
|
||||
key: v3-react-navigation-{{ .Branch }}-{{ checksum "package.json" }}
|
||||
paths:
|
||||
- ~/.cache/yarn
|
||||
- ~/react-navigation/examples/NavigationPlayground/node_modules
|
||||
- ~/react-navigation/examples/ReduxExample/node_modules
|
||||
notify:
|
||||
webhooks:
|
||||
- url: https://react-navigation-ci.now.sh
|
||||
# notify:
|
||||
# webhooks:
|
||||
# - url: https://react-navigation-ci.now.sh
|
||||
|
||||
146
CHANGELOG.md
146
CHANGELOG.md
@@ -7,6 +7,131 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [3.3.2] - [2019-02-25](https://github.com/react-navigation/react-navigation/releases/tag/3.3.2)
|
||||
|
||||
## Fixed
|
||||
|
||||
- Updated Flow types (https://github.com/react-navigation/react-navigation/commit/d3040e52b39bc8e91ffc1354d9c5f8c096baf597)
|
||||
|
||||
## [3.3.1] - [2019-02-25](https://github.com/react-navigation/react-navigation/releases/tag/3.3.1)
|
||||
|
||||
## Fixed
|
||||
|
||||
- SafeAreaView bottom inset on iPhone XR and XS fixed. (https://github.com/react-navigation/react-navigation/issues/5625)
|
||||
|
||||
## [3.3.0] - [2019-02-16](https://github.com/react-navigation/react-navigation/releases/tag/3.3.0)
|
||||
|
||||
## Added
|
||||
|
||||
- Pass through `drawerOpenProgress` to drawer content component (https://github.com/react-navigation/react-navigation-drawer/pull/40)
|
||||
|
||||
## [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)
|
||||
|
||||
## Fixes
|
||||
@@ -20,7 +145,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
- fix NavigationTestUtils.js deprecated file import.
|
||||
- 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)
|
||||
|
||||
@@ -30,7 +155,24 @@ 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)
|
||||
|
||||
[Unreleased]: https://github.com/react-navigation/react-navigation/compare/3.0.2...HEAD
|
||||
[Unreleased]: https://github.com/react-navigation/react-navigation/compare/3.3.2...HEAD
|
||||
[3.3.2]: https://github.com/react-navigation/react-navigation/compare/3.3.1...3.3.2
|
||||
[3.3.1]: https://github.com/react-navigation/react-navigation/compare/3.3.0...3.3.1
|
||||
[3.3.0]: https://github.com/react-navigation/react-navigation/compare/3.2.3...3.3.0
|
||||
[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.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
|
||||
|
||||
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
|
||||
|
||||
Since the library is a JS-based solution, to install the latest version of react-navigation you only need to run:
|
||||
|
||||
```bash
|
||||
yarn add react-navigation
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
npm install --save react-navigation
|
||||
```
|
||||
See: https://reactnavigation.org/docs/en/getting-started.html
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
{
|
||||
"presets": [
|
||||
"babel-preset-expo"
|
||||
],
|
||||
"env": {
|
||||
"development": {
|
||||
"plugins": [
|
||||
"transform-react-jsx-source"
|
||||
],
|
||||
},
|
||||
"production": {
|
||||
"plugins": [
|
||||
"transform-remove-console"
|
||||
]
|
||||
}
|
||||
}
|
||||
"expo"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
# 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
|
||||
|
||||
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": {
|
||||
"image": "./assets/icons/splash.png"
|
||||
},
|
||||
"sdkVersion": "30.0.0",
|
||||
"sdkVersion": "32.0.0",
|
||||
"assetBundlePatterns": [
|
||||
"**/*"
|
||||
],
|
||||
@@ -23,4 +23,4 @@
|
||||
"package": "com.reactnavigation.example"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class MyHomeScreen extends React.Component {
|
||||
tabBarLabel: 'Home',
|
||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-home' : 'ios-home-outline'}
|
||||
name={focused ? 'ios-home' : 'ios-home'}
|
||||
size={horizontal ? 20 : 26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
@@ -41,7 +41,7 @@ class ReccomendedScreen extends React.Component {
|
||||
tabBarLabel: 'Reccomended',
|
||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-people' : 'ios-people-outline'}
|
||||
name={focused ? 'ios-people' : 'ios-people'}
|
||||
size={horizontal ? 20 : 26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
@@ -67,7 +67,7 @@ class FeaturedScreen extends React.Component {
|
||||
tabBarLabel: 'Featured',
|
||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-star' : 'ios-star-outline'}
|
||||
name={focused ? 'ios-star' : 'ios-star'}
|
||||
size={horizontal ? 20 : 26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
|
||||
@@ -73,7 +73,7 @@ MyHomeScreen.navigationOptions = {
|
||||
tabBarLabel: 'Home',
|
||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-home' : 'ios-home-outline'}
|
||||
name={'ios-home'}
|
||||
size={horizontal ? 20 : 26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
@@ -94,7 +94,7 @@ class MyPeopleScreen extends React.Component<MyPeopleScreenProps> {
|
||||
tabBarLabel: 'People',
|
||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-people' : 'ios-people-outline'}
|
||||
name={'ios-people'}
|
||||
size={horizontal ? 20 : 26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
@@ -134,7 +134,7 @@ class MyChatScreen extends React.Component<MyChatScreenProps> {
|
||||
tabBarLabel: 'Chat',
|
||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-chatboxes' : 'ios-chatboxes-outline'}
|
||||
name={'ios-chatboxes'}
|
||||
size={horizontal ? 20 : 26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
@@ -169,7 +169,7 @@ MySettingsScreen.navigationOptions = {
|
||||
tabBarLabel: 'Settings',
|
||||
tabBarIcon: ({ tintColor, focused, horizontal }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-settings' : 'ios-settings-outline'}
|
||||
name={'ios-settings'}
|
||||
size={horizontal ? 20 : 26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
@@ -196,6 +196,7 @@ const SimpleTabs = createBottomTabNavigator(
|
||||
},
|
||||
},
|
||||
{
|
||||
backBehavior: 'history',
|
||||
tabBarOptions: {
|
||||
activeTintColor: '#e91e63',
|
||||
},
|
||||
|
||||
@@ -109,7 +109,7 @@ const StacksInTabs = createBottomTabNavigator(
|
||||
tabBarLabel: 'Home',
|
||||
tabBarIcon: ({ tintColor, focused }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-home' : 'ios-home-outline'}
|
||||
name={focused ? 'ios-home' : 'ios-home'}
|
||||
size={26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
@@ -123,7 +123,7 @@ const StacksInTabs = createBottomTabNavigator(
|
||||
tabBarLabel: 'Settings',
|
||||
tabBarIcon: ({ tintColor, focused }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-settings' : 'ios-settings-outline'}
|
||||
name={focused ? 'ios-settings' : 'ios-settings'}
|
||||
size={26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
|
||||
@@ -66,7 +66,7 @@ const TabNav = createBottomTabNavigator(
|
||||
tabBarLabel: 'Home',
|
||||
tabBarIcon: ({ tintColor, focused }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-home' : 'ios-home-outline'}
|
||||
name={focused ? 'ios-home' : 'ios-home'}
|
||||
size={26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
@@ -80,7 +80,7 @@ const TabNav = createBottomTabNavigator(
|
||||
title: 'Settings',
|
||||
tabBarIcon: ({ tintColor, focused }) => (
|
||||
<Ionicons
|
||||
name={focused ? 'ios-settings' : 'ios-settings-outline'}
|
||||
name={focused ? 'ios-settings' : 'ios-settings'}
|
||||
size={26}
|
||||
style={{ color: tintColor }}
|
||||
/>
|
||||
|
||||
@@ -105,15 +105,15 @@ const createTabScreen = (name, icon, focusedIcon) => {
|
||||
const TabsWithNavigationEvents = createMaterialBottomTabNavigator(
|
||||
{
|
||||
One: {
|
||||
screen: createTabScreen('One', 'numeric-1-box-outline', 'numeric-1-box'),
|
||||
screen: createTabScreen('One', 'numeric-1-box', 'numeric-1-box'),
|
||||
},
|
||||
Two: {
|
||||
screen: createTabScreen('Two', 'numeric-2-box-outline', 'numeric-2-box'),
|
||||
screen: createTabScreen('Two', 'numeric-2-box', 'numeric-2-box'),
|
||||
},
|
||||
Three: {
|
||||
screen: createTabScreen(
|
||||
'Three',
|
||||
'numeric-3-box-outline',
|
||||
'numeric-3-box',
|
||||
'numeric-3-box'
|
||||
),
|
||||
},
|
||||
|
||||
@@ -81,15 +81,15 @@ const createTabScreen = (name, icon, focusedIcon, tintColor = '#673ab7') => {
|
||||
const TabsWithNavigationFocus = createMaterialBottomTabNavigator(
|
||||
{
|
||||
One: {
|
||||
screen: createTabScreen('One', 'numeric-1-box-outline', 'numeric-1-box'),
|
||||
screen: createTabScreen('One', 'numeric-1-box', 'numeric-1-box'),
|
||||
},
|
||||
Two: {
|
||||
screen: createTabScreen('Two', 'numeric-2-box-outline', 'numeric-2-box'),
|
||||
screen: createTabScreen('Two', 'numeric-2-box', 'numeric-2-box'),
|
||||
},
|
||||
Three: {
|
||||
screen: createTabScreen(
|
||||
'Three',
|
||||
'numeric-3-box-outline',
|
||||
'numeric-3-box',
|
||||
'numeric-3-box'
|
||||
),
|
||||
},
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
"private": true,
|
||||
"main": "node_modules/expo/AppEntry.js",
|
||||
"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",
|
||||
"android": "expo start --android",
|
||||
"ios": "expo start --ios",
|
||||
"test": "flow"
|
||||
},
|
||||
"dependencies": {
|
||||
"expo": "^30.0.0",
|
||||
"expo": "^32.0.0",
|
||||
"hoist-non-react-statics": "^3.0.1",
|
||||
"invariant": "^2.2.4",
|
||||
"react": "16.3.1",
|
||||
"react-native": "^0.55.0",
|
||||
"react": "16.5.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-paper": "^2.1.3",
|
||||
"react-navigation": "link:../..",
|
||||
"react-navigation": "../..",
|
||||
"react-navigation-header-buttons": "^0.0.4",
|
||||
"react-navigation-material-bottom-tabs": "1.0.0"
|
||||
},
|
||||
@@ -38,13 +38,6 @@
|
||||
"json",
|
||||
"jsx",
|
||||
"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.
|
||||
135
flow/react-navigation.js
vendored
135
flow/react-navigation.js
vendored
@@ -44,18 +44,68 @@ declare module 'react-navigation' {
|
||||
};
|
||||
declare type ImageSource = ImageURISource | number | Array<ImageURISource>;
|
||||
|
||||
// This one is too large to copy. Actual definition is in
|
||||
// react-native/Libraries/Animated/src/nodes/AnimatedValue.js
|
||||
declare type AnimatedValue = Object;
|
||||
|
||||
declare type HeaderForceInset = {
|
||||
horizontal?: string,
|
||||
vertical?: string,
|
||||
left?: string,
|
||||
right?: string,
|
||||
top?: string,
|
||||
bottom?: string,
|
||||
// This is copied from
|
||||
// react-native/Libraries/Animated/src/nodes/AnimatedInterpolation.js
|
||||
declare type ExtrapolateType = 'extend' | 'identity' | 'clamp';
|
||||
declare type InterpolationConfigType = {
|
||||
inputRange: Array<number>,
|
||||
outputRange: Array<number> | Array<string>,
|
||||
easing?: (input: number) => number,
|
||||
extrapolate?: ExtrapolateType,
|
||||
extrapolateLeft?: ExtrapolateType,
|
||||
extrapolateRight?: ExtrapolateType,
|
||||
};
|
||||
declare class AnimatedInterpolation {
|
||||
interpolate(config: InterpolationConfigType): AnimatedInterpolation;
|
||||
}
|
||||
|
||||
// This is copied from
|
||||
// react-native/Libraries/Animated/src/animations/Animation.js
|
||||
declare type EndResult = { finished: boolean };
|
||||
declare type EndCallback = (result: EndResult) => void;
|
||||
declare class Animation {
|
||||
start(
|
||||
fromValue: number,
|
||||
onUpdate: (value: number) => void,
|
||||
onEnd: ?EndCallback,
|
||||
previousAnimation: ?Animation,
|
||||
animatedValue: AnimatedValue
|
||||
): void;
|
||||
stop(): void;
|
||||
}
|
||||
|
||||
// This is vaguely copied from
|
||||
// react-native/Libraries/Animated/src/nodes/AnimatedTracking.js
|
||||
declare class AnimatedTracking {
|
||||
constructor(
|
||||
value: AnimatedValue,
|
||||
parent: any,
|
||||
animationClass: any,
|
||||
animationConfig: Object,
|
||||
callback?: ?EndCallback
|
||||
): void;
|
||||
update(): void;
|
||||
}
|
||||
|
||||
// This is vaguely copied from
|
||||
// react-native/Libraries/Animated/src/nodes/AnimatedValue.js
|
||||
declare type ValueListenerCallback = (state: { value: number }) => void;
|
||||
declare class AnimatedValue {
|
||||
constructor(value: number): void;
|
||||
setValue(value: number): void;
|
||||
setOffset(offset: number): void;
|
||||
flattenOffset(): void;
|
||||
extractOffset(): void;
|
||||
addListener(callback: ValueListenerCallback): string;
|
||||
removeListener(id: string): void;
|
||||
removeAllListeners(): void;
|
||||
stopAnimation(callback?: ?(value: number) => void): void;
|
||||
resetAnimation(callback?: ?(value: number) => void): void;
|
||||
interpolate(config: InterpolationConfigType): AnimatedInterpolation;
|
||||
animate(animation: Animation, callback: ?EndCallback): void;
|
||||
stopTracking(): void;
|
||||
track(tracking: AnimatedTracking): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Next, all the type declarations
|
||||
@@ -385,7 +435,7 @@ declare module 'react-navigation' {
|
||||
headerPressColorAndroid?: string,
|
||||
headerRight?: React$Node,
|
||||
headerStyle?: ViewStyleProp,
|
||||
headerForceInset?: HeaderForceInset,
|
||||
headerForceInset?: _SafeAreaViewInsets,
|
||||
headerBackground?: React$Node | React$ElementType,
|
||||
gesturesEnabled?: boolean,
|
||||
gestureResponseDistance?: { vertical?: number, horizontal?: number },
|
||||
@@ -678,8 +728,8 @@ declare module 'react-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
|
||||
// to 1.
|
||||
// progress.__getAnimatedValue() < 1 : transtion is happening.
|
||||
// progress.__getAnimatedValue() == 1 : transtion completes.
|
||||
// progress.__getAnimatedValue() < 1 : transition is happening.
|
||||
// progress.__getAnimatedValue() == 1 : transition completes.
|
||||
progress: AnimatedValue,
|
||||
|
||||
// All the scenes of the transitioner.
|
||||
@@ -892,10 +942,6 @@ declare module 'react-navigation' {
|
||||
navigatorConfig?: NavigatorConfig
|
||||
): NavigationNavigator<S, O, *>;
|
||||
|
||||
declare export function StackNavigator(
|
||||
routeConfigMap: NavigationRouteConfigMap,
|
||||
stackConfig?: StackNavigatorConfig
|
||||
): NavigationNavigator<*, *, *>;
|
||||
declare export function createStackNavigator(
|
||||
routeConfigMap: NavigationRouteConfigMap,
|
||||
stackConfig?: StackNavigatorConfig
|
||||
@@ -920,14 +966,6 @@ declare module 'react-navigation' {
|
||||
removeClippedSubviews?: boolean,
|
||||
containerOptions?: void,
|
||||
|};
|
||||
declare export function TabNavigator(
|
||||
routeConfigs: NavigationRouteConfigMap,
|
||||
config?: _TabNavigatorConfig
|
||||
): NavigationNavigator<*, *, *>;
|
||||
declare export function createTabNavigator(
|
||||
routeConfigs: NavigationRouteConfigMap,
|
||||
config?: _TabNavigatorConfig
|
||||
): NavigationNavigator<*, *, *>;
|
||||
/* TODO: fix the config for each of these tab navigator types */
|
||||
declare export function createBottomTabNavigator(
|
||||
routeConfigs: NavigationRouteConfigMap,
|
||||
@@ -940,10 +978,6 @@ declare module 'react-navigation' {
|
||||
declare type _SwitchNavigatorConfig = {|
|
||||
...NavigationSwitchRouterConfig,
|
||||
|};
|
||||
declare export function SwitchNavigator(
|
||||
routeConfigs: NavigationRouteConfigMap,
|
||||
config?: _SwitchNavigatorConfig
|
||||
): NavigationNavigator<*, *, *>;
|
||||
declare export function createSwitchNavigator(
|
||||
routeConfigs: NavigationRouteConfigMap,
|
||||
config?: _SwitchNavigatorConfig
|
||||
@@ -965,10 +999,6 @@ declare module 'react-navigation' {
|
||||
..._DrawerViewConfig,
|
||||
containerConfig?: void,
|
||||
}>;
|
||||
declare export function DrawerNavigator(
|
||||
routeConfigs: NavigationRouteConfigMap,
|
||||
config?: _DrawerNavigatorConfig
|
||||
): NavigationNavigator<*, *, *>;
|
||||
declare export function createDrawerNavigator(
|
||||
routeConfigs: NavigationRouteConfigMap,
|
||||
config?: _DrawerNavigatorConfig
|
||||
@@ -1049,15 +1079,16 @@ declare module 'react-navigation' {
|
||||
declare export var Card: React$ComponentType<_CardProps>;
|
||||
|
||||
declare type _SafeAreaViewForceInsetValue = 'always' | 'never' | number;
|
||||
declare type _SafeAreaViewInsets = $Shape<{
|
||||
top: _SafeAreaViewForceInsetValue,
|
||||
bottom: _SafeAreaViewForceInsetValue,
|
||||
left: _SafeAreaViewForceInsetValue,
|
||||
right: _SafeAreaViewForceInsetValue,
|
||||
vertical: _SafeAreaViewForceInsetValue,
|
||||
horizontal: _SafeAreaViewForceInsetValue,
|
||||
}>;
|
||||
declare type _SafeAreaViewProps = {
|
||||
forceInset?: {
|
||||
top?: _SafeAreaViewForceInsetValue,
|
||||
bottom?: _SafeAreaViewForceInsetValue,
|
||||
left?: _SafeAreaViewForceInsetValue,
|
||||
right?: _SafeAreaViewForceInsetValue,
|
||||
vertical?: _SafeAreaViewForceInsetValue,
|
||||
horizontal?: _SafeAreaViewForceInsetValue,
|
||||
},
|
||||
forceInset?: _SafeAreaViewInsets,
|
||||
children?: React$Node,
|
||||
style?: AnimatedViewStyleProp,
|
||||
};
|
||||
@@ -1208,19 +1239,27 @@ declare module 'react-navigation' {
|
||||
};
|
||||
declare export var TabBarBottom: React$ComponentType<_TabBarBottomProps>;
|
||||
|
||||
declare export function withNavigation<Props: {}>(
|
||||
Component: React$ComponentType<Props>
|
||||
declare export function withNavigation<
|
||||
Props: {},
|
||||
ComponentType: React$ComponentType<Props>
|
||||
>(
|
||||
Component: ComponentType
|
||||
): React$ComponentType<
|
||||
$Diff<
|
||||
Props,
|
||||
React$ElementConfig<ComponentType>,
|
||||
{
|
||||
navigation: NavigationScreenProp<NavigationStateRoute> | void,
|
||||
}
|
||||
>
|
||||
>;
|
||||
declare export function withNavigationFocus<Props: {}>(
|
||||
Component: React$ComponentType<Props>
|
||||
): React$ComponentType<$Diff<Props, { isFocused: boolean | void }>>;
|
||||
declare export function withNavigationFocus<
|
||||
Props: {},
|
||||
ComponentType: React$ComponentType<Props>
|
||||
>(
|
||||
Component: ComponentType
|
||||
): React$ComponentType<
|
||||
$Diff<React$ElementConfig<ComponentType>, { isFocused: boolean | void }>
|
||||
>;
|
||||
|
||||
declare export function getNavigation<State: NavigationState, Options: {}>(
|
||||
router: NavigationRouter<State, Options>,
|
||||
|
||||
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-navigation",
|
||||
"version": "3.0.2",
|
||||
"version": "3.3.2",
|
||||
"description": "Routing and navigation for your React Native apps",
|
||||
"main": "src/react-navigation.js",
|
||||
"repository": {
|
||||
@@ -34,11 +34,11 @@
|
||||
"react-native": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/core": "^3.0.0",
|
||||
"@react-navigation/native": "^3.0.1",
|
||||
"react-navigation-drawer": "^1.0.3",
|
||||
"react-navigation-stack": "^1.0.2",
|
||||
"react-navigation-tabs": "^1.0.0"
|
||||
"@react-navigation/core": "3.1.1",
|
||||
"@react-navigation/native": "3.1.5",
|
||||
"react-navigation-drawer": "1.2.0",
|
||||
"react-navigation-stack": "1.0.10",
|
||||
"react-navigation-tabs": "1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.24.1",
|
||||
|
||||
Reference in New Issue
Block a user