mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 22:39:41 +08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed9ee4d5e5 | ||
|
|
36f9788e85 | ||
|
|
712ec9bab1 | ||
|
|
786456b645 | ||
|
|
3d7a62490c | ||
|
|
445e4d95b8 | ||
|
|
9c12052199 | ||
|
|
994c2c0828 | ||
|
|
c27a197ddb |
40
CHANGELOG.md
40
CHANGELOG.md
@@ -7,6 +7,40 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
|
||||||
|
## [2.18.3] - [2018-11-26](https://github.com/react-navigation/react-navigation/releases/tag/2.18.3)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Support React.forwardRef on createStackNavigator
|
||||||
|
|
||||||
|
## [2.18.2] - [2018-10-26](https://github.com/react-navigation/react-navigation/releases/tag/2.18.2)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Revert "Backport fix for child navigation object caching" due to edge case with transitioner
|
||||||
|
|
||||||
|
## [2.18.1] - [2018-10-23](https://github.com/react-navigation/react-navigation/releases/tag/2.18.1)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Backport fix for child navigation object caching
|
||||||
|
|
||||||
|
## [2.18.0] - [2018-10-11](https://github.com/react-navigation/react-navigation/releases/tag/2.18.0)
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Introduce getActiveChildNavigationOptions (#5080)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated react-navigation-tabs to 0.8.4 to fix issue with Snack
|
||||||
|
- Flow changes:
|
||||||
|
- Update StackViewConfig to match recent changes (#5067)
|
||||||
|
- Mark key in StackActions.replace as optional (#5073)
|
||||||
|
- Remove drawer actions from react-navigation-web
|
||||||
|
- Add disableRouteNamePaths option to router configs (#4824)
|
||||||
|
|
||||||
## [2.17.0] - [2018-09-25](https://github.com/react-navigation/react-navigation/releases/tag/2.17.0)
|
## [2.17.0] - [2018-09-25](https://github.com/react-navigation/react-navigation/releases/tag/2.17.0)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
@@ -218,7 +252,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
### Changed
|
### Changed
|
||||||
- Improved examples
|
- Improved examples
|
||||||
|
|
||||||
[Unreleased]: https://github.com/react-navigation/react-navigation/compare/2.17.0...HEAD
|
[Unreleased]: https://github.com/react-navigation/react-navigation/compare/2.18.3...HEAD
|
||||||
|
[2.18.3]: https://github.com/react-navigation/react-navigation/compare/2.18.2...2.18.3
|
||||||
|
[2.18.2]: https://github.com/react-navigation/react-navigation/compare/2.18.1...2.18.2
|
||||||
|
[2.18.1]: https://github.com/react-navigation/react-navigation/compare/2.18.0...2.18.1
|
||||||
|
[2.18.0]: https://github.com/react-navigation/react-navigation/compare/2.17.0...2.18.0
|
||||||
[2.17.0]: https://github.com/react-navigation/react-navigation/compare/2.16.0...2.17.0
|
[2.17.0]: https://github.com/react-navigation/react-navigation/compare/2.16.0...2.17.0
|
||||||
[2.16.0]: https://github.com/react-navigation/react-navigation/compare/2.15.0...2.16.0
|
[2.16.0]: https://github.com/react-navigation/react-navigation/compare/2.15.0...2.16.0
|
||||||
[2.15.0]: https://github.com/react-navigation/react-navigation/compare/2.14.2...2.15.0
|
[2.15.0]: https://github.com/react-navigation/react-navigation/compare/2.14.2...2.15.0
|
||||||
|
|||||||
@@ -5543,10 +5543,10 @@ react-navigation-stack@0.7.0:
|
|||||||
resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-0.7.0.tgz#0b2f139ee1cba953037ef51353df992ec6c74fa2"
|
resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-0.7.0.tgz#0b2f139ee1cba953037ef51353df992ec6c74fa2"
|
||||||
integrity sha512-3Tbb/SsustBrM9R/qaI6XuOfyqYMVbwkeHFC8NbU890vB0aKZvjAtioWLZ18e/4LgbiOCmoTdp37z3gkGDyNDQ==
|
integrity sha512-3Tbb/SsustBrM9R/qaI6XuOfyqYMVbwkeHFC8NbU890vB0aKZvjAtioWLZ18e/4LgbiOCmoTdp37z3gkGDyNDQ==
|
||||||
|
|
||||||
react-navigation-tabs@0.8.2:
|
react-navigation-tabs@0.8.4:
|
||||||
version "0.8.2"
|
version "0.8.4"
|
||||||
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.8.2.tgz#65f8a6ce368684227603345b4d312da2ef3366e1"
|
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.8.4.tgz#aa767f28b899f13c99f2b034b4a665f8cf0a5737"
|
||||||
integrity sha512-q2xfY79ERj4XJek3rceveifUny3Qcg7y6bNlN6wQg6c7D/pMFOGZsSALGenF7CuNDhYyEkijlnGTHl1laZgbDw==
|
integrity sha512-CbS3xIVJVtpu+AYslv0PMLmjddJFVtU3XAhSJ9XnMrKLUJNmnQdW/L0w/Gp5qcBEF9h6bgsY3CoTtp7I6bqyOQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
hoist-non-react-statics "^2.5.0"
|
hoist-non-react-statics "^2.5.0"
|
||||||
prop-types "^15.6.1"
|
prop-types "^15.6.1"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-navigation",
|
"name": "react-navigation",
|
||||||
"version": "2.17.0",
|
"version": "2.18.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": {
|
||||||
@@ -35,13 +35,14 @@
|
|||||||
"hoist-non-react-statics": "^2.2.0",
|
"hoist-non-react-statics": "^2.2.0",
|
||||||
"path-to-regexp": "^1.7.0",
|
"path-to-regexp": "^1.7.0",
|
||||||
"query-string": "^6.1.0",
|
"query-string": "^6.1.0",
|
||||||
|
"react-is": "^16.5.2",
|
||||||
"react-lifecycles-compat": "^3",
|
"react-lifecycles-compat": "^3",
|
||||||
"react-native-safe-area-view": "0.11.0",
|
"react-native-safe-area-view": "0.11.0",
|
||||||
"react-native-screens": "^1.0.0-alpha.11",
|
"react-native-screens": "^1.0.0-alpha.11",
|
||||||
"react-navigation-deprecated-tab-navigator": "1.3.0",
|
"react-navigation-deprecated-tab-navigator": "1.3.0",
|
||||||
"react-navigation-drawer": "0.5.0",
|
"react-navigation-drawer": "0.5.0",
|
||||||
"react-navigation-stack": "0.7.0",
|
"react-navigation-stack": "0.7.0",
|
||||||
"react-navigation-tabs": "0.8.2"
|
"react-navigation-tabs": "0.8.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-cli": "^6.24.1",
|
"babel-cli": "^6.24.1",
|
||||||
@@ -62,7 +63,7 @@
|
|||||||
"lint-staged": "^4.2.1",
|
"lint-staged": "^4.2.1",
|
||||||
"prettier": "^1.12.1",
|
"prettier": "^1.12.1",
|
||||||
"prettier-eslint": "^8.8.1",
|
"prettier-eslint": "^8.8.1",
|
||||||
"react": "16.2.0",
|
"react": "16.5.2",
|
||||||
"react-native": "^0.52.0",
|
"react-native": "^0.52.0",
|
||||||
"react-native-vector-icons": "^4.2.0",
|
"react-native-vector-icons": "^4.2.0",
|
||||||
"react-test-renderer": "^16.0.0"
|
"react-test-renderer": "^16.0.0"
|
||||||
|
|||||||
@@ -543,8 +543,10 @@ export default (routeConfigs, stackConfig = {}) => {
|
|||||||
state,
|
state,
|
||||||
childRoute.key,
|
childRoute.key,
|
||||||
route,
|
route,
|
||||||
// the following tells replaceAt to NOT change the index to this route for the setParam action, because people don't expect param-setting actions to switch the active route
|
// the following tells replaceAt to NOT change the index to this route for the setParam action or complete transition action,
|
||||||
action.type === NavigationActions.SET_PARAMS
|
// because people don't expect these actions to switch the active route
|
||||||
|
action.type === NavigationActions.SET_PARAMS ||
|
||||||
|
action.type === StackActions.COMPLETE_TRANSITION
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ ProfileNavigator.router = StackRouter({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const ScreenWithForwardRef = React.forwardRef((props, ref) => (
|
||||||
|
<div ref={ref} />
|
||||||
|
));
|
||||||
|
|
||||||
describe('validateRouteConfigMap', () => {
|
describe('validateRouteConfigMap', () => {
|
||||||
test('Fails on empty bare screen', () => {
|
test('Fails on empty bare screen', () => {
|
||||||
const invalidMap = {
|
const invalidMap = {
|
||||||
@@ -57,4 +61,10 @@ describe('validateRouteConfigMap', () => {
|
|||||||
};
|
};
|
||||||
validateRouteConfigMap(validMap);
|
validateRouteConfigMap(validMap);
|
||||||
});
|
});
|
||||||
|
test('Succeeds on React.forwardRef', () => {
|
||||||
|
const validMap = {
|
||||||
|
Chat: ScreenWithForwardRef,
|
||||||
|
};
|
||||||
|
validateRouteConfigMap(validMap);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { isValidElementType } from 'react-is';
|
||||||
import invariant from '../utils/invariant';
|
import invariant from '../utils/invariant';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,7 +24,7 @@ export default function getScreenForRouteName(routeConfigs, routeName) {
|
|||||||
if (typeof routeConfig.getScreen === 'function') {
|
if (typeof routeConfig.getScreen === 'function') {
|
||||||
const screen = routeConfig.getScreen();
|
const screen = routeConfig.getScreen();
|
||||||
invariant(
|
invariant(
|
||||||
typeof screen === 'function',
|
isValidElementType(screen),
|
||||||
`The getScreen defined for route '${routeName} didn't return a valid ` +
|
`The getScreen defined for route '${routeName} didn't return a valid ` +
|
||||||
'screen or navigator.\n\n' +
|
'screen or navigator.\n\n' +
|
||||||
'Please pass it like this:\n' +
|
'Please pass it like this:\n' +
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { isValidElementType } from 'react-is';
|
||||||
import invariant from '../utils/invariant';
|
import invariant from '../utils/invariant';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,9 +18,7 @@ function validateRouteConfigMap(routeConfigs) {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
!screenComponent ||
|
!screenComponent ||
|
||||||
(typeof screenComponent !== 'function' &&
|
(!isValidElementType(screenComponent) && !routeConfig.getScreen)
|
||||||
typeof screenComponent !== 'string' &&
|
|
||||||
!routeConfig.getScreen)
|
|
||||||
) {
|
) {
|
||||||
throw new Error(`The component for route '${routeName}' must be a React component. For example:
|
throw new Error(`The component for route '${routeName}' must be a React component. For example:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user