Compare commits

...

4 Commits

Author SHA1 Message Date
Brent Vatne
f9fbffbfa0 Release 1.1.0 2018-02-19 18:15:37 -08:00
Brent Vatne
1b8422d77d Fix TabRouter to support shorthand route config 2018-02-19 18:13:22 -08:00
Brent Vatne
e27afea7ab Release 1.1.0-rc.5 2018-02-19 14:46:39 -08:00
Brent Vatne
ca6cd89118 Fix regression in modular back button 2018-02-19 14:46:25 -08:00
4 changed files with 10 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "react-navigation",
"version": "1.1.0-rc.4",
"version": "1.1.0",
"description": "Routing and navigation for your React Native apps",
"main": "src/react-navigation.js",
"repository": {

View File

@@ -30,8 +30,9 @@ export default (routeConfigs, config = {}) => {
paths[routeName] =
typeof routeConfig.path === 'string' ? routeConfig.path : routeName;
tabRouters[routeName] = null;
if (routeConfig.screen && routeConfig.screen.router) {
tabRouters[routeName] = routeConfig.screen.router;
const screen = getScreenForRouteName(routeConfigs, routeName);
if (screen.router) {
tabRouters[routeName] = screen.router;
}
});
if (initialRouteIndex === -1) {

View File

@@ -277,6 +277,11 @@ class Header extends React.PureComponent {
const { scene } = props;
const { index, isStale, key } = scene;
// Never render a modular back button on the first screen in a stack.
if (index === 0) {
return;
}
const offset = this.props.navigation.state.index - index;
if (Math.abs(offset) > 2) {

View File

@@ -42,7 +42,7 @@ class ModularHeaderBackButton extends React.PureComponent {
// TODO: When we've sorted out measuring in the header, let's revisit this.
// This is clearly a bad workaround.
if (backButtonTitle.length > 8) {
if (backButtonTitle && backButtonTitle.length > 8) {
backButtonTitle = truncatedTitle;
}