Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3c4ebc3
Fix onTransitionStart and onTransitionEnd in StackView
fr1n63 May 1, 2018
8eb41ca
Prettier
fr1n63 May 1, 2018
80ea5f3
Prettierr
fr1n63 May 1, 2018
fd7ca92
Run prettier properly, remove dead import
martin-thoughtmachine May 1, 2018
c641bee
Fix initial action dispatch for nonPersisted apps (#4104)
ericvicenti May 2, 2018
47fe858
StateUtils: Use Array.prototype.findIndex instead of map => indexOf (…
simonbuerger May 3, 2018
2440af6
add a test so that #2856 can be closed (#4102)
vonovak May 3, 2018
e0df3cf
Fix issue with nested navigation actions in stack (#4114)
ericvicenti May 3, 2018
df281cf
Add router tests to clarify route resolution
brentvatne May 3, 2018
ab5481a
Add context around a test in switchrouter
brentvatne May 3, 2018
723c5f2
Fix drawer navigation dispatch (#4121)
ericvicenti May 4, 2018
eda9bfd
Update react-lifecycles-compat
brentvatne May 4, 2018
8ed3817
Fix event unsubscription logic (#4116)
ericvicenti May 4, 2018
8e52995
Release 2.0.0-rc.8
brentvatne May 4, 2018
2643f69
Pull createMaterialBottomTabNavigator into separate repo
brentvatne May 4, 2018
ad7cde9
Release 2.0.0-rc.9
brentvatne May 4, 2018
c1a9489
Fix drawer stack reset-to-top behavior (#4132)
ericvicenti May 6, 2018
f6bd3e4
Fix setting undefined value to isTransitioning (#4124)
lebedev May 6, 2018
9f95a7f
Fix CompletionAction trigger (#4115)
ericvicenti May 6, 2018
4e8d8ce
Fixes to drawer router handling of child routers (#4131)
ericvicenti May 6, 2018
1bd6593
Release 2.0.0-rc.10
brentvatne May 6, 2018
8ec2466
Fix for broken swipe back gesture in RTL mode (#4119)
May 6, 2018
4533883
Release 2.0.0-rc.11
brentvatne May 6, 2018
1ceda5f
Update react-navigation-deprecated-tab-navigator. Closes #4147
brentvatne May 7, 2018
39d5714
Release 2.0.0-rc.12
brentvatne May 7, 2018
6499f02
Only blur input when index changes on transition start (Fixes #4148)
brentvatne May 7, 2018
2fd7284
Release candidate lucky number 13
brentvatne May 7, 2018
364144d
Navigation Action Helpers at root (#4151)
ericvicenti May 7, 2018
589b80b
Update drawer example
brentvatne May 7, 2018
93db7d0
Release 2.0.0-rc.14
brentvatne May 7, 2018
ec1694f
Release 2.0.0
brentvatne May 7, 2018
e97d6b2
Fix dispatch implementation (#4168)
ericvicenti May 9, 2018
1876706
Release 2.0.1
brentvatne May 9, 2018
9312711
Remove unused code addNavigationHelpers (#4179)
skabbes May 9, 2018
2243528
Cache panResponder in StackView (#4183)
ericvicenti May 10, 2018
08e1b53
Update playground yarn lockfile
ericvicenti May 12, 2018
9991632
Don't warn about multiple navigation containers on Android
brentvatne May 22, 2018
d168ab2
Release 2.0.2
brentvatne May 22, 2018
2bb48b9
Revert yarn.lock
martin-thoughtmachine May 22, 2018
638a791
Resolve conflict
martin-thoughtmachine May 22, 2018
dff145b
Merge branch 'master' into fr1n63-fix-transition-callbacks
fr1n63 May 22, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/NavigationPlayground/js/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ const AppNavigator = createStackNavigator(
}
);

export default () => <AppNavigator persistenceKey="NavState" />;
export default AppNavigator;

const styles = StyleSheet.create({
item: {
Expand Down
32 changes: 20 additions & 12 deletions examples/NavigationPlayground/js/Drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@ const InboxScreen = ({ navigation }) => (
<MyNavScreen banner={'Inbox Screen'} navigation={navigation} />
);
InboxScreen.navigationOptions = {
drawerLabel: 'Inbox',
drawerIcon: ({ tintColor }) => (
<MaterialIcons
name="move-to-inbox"
size={24}
style={{ color: tintColor }}
/>
),
headerTitle: 'Inbox',
};

const EmailScreen = ({ navigation }) => (
Expand All @@ -50,22 +43,37 @@ const DraftsScreen = ({ navigation }) => (
<MyNavScreen banner={'Drafts Screen'} navigation={navigation} />
);
DraftsScreen.navigationOptions = {
drawerLabel: 'Drafts',
drawerIcon: ({ tintColor }) => (
<MaterialIcons name="drafts" size={24} style={{ color: tintColor }} />
),
headerTitle: 'Drafts',
};

const InboxStack = createStackNavigator({
Inbox: { screen: InboxScreen },
Email: { screen: EmailScreen },
});

InboxStack.navigationOptions = {
drawerLabel: 'Inbox',
drawerIcon: ({ tintColor }) => (
<MaterialIcons
name="move-to-inbox"
size={24}
style={{ color: tintColor }}
/>
),
};

const DraftsStack = createStackNavigator({
Drafts: { screen: DraftsScreen },
Email: { screen: EmailScreen },
});

DraftsStack.navigationOptions = {
drawerLabel: 'Drafts',
drawerIcon: ({ tintColor }) => (
<MaterialIcons name="drafts" size={24} style={{ color: tintColor }} />
),
};

const DrawerExample = createDrawerNavigator(
{
Inbox: {
Expand Down
7 changes: 4 additions & 3 deletions examples/NavigationPlayground/js/KeyboardHandlingExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class ScreenOne extends React.Component {
}

class ScreenTwo extends React.Component {
static navigationOptions = {
title: 'Screen w/ Input',
};
static navigationOptions = ({ navigation }) => ({
title: navigation.getParam('inputValue', 'Screen w/ Input'),
});

componentDidMount() {
InteractionManager.runAfterInteractions(() => {
Expand All @@ -41,6 +41,7 @@ class ScreenTwo extends React.Component {
<View style={{ alignSelf: 'center', paddingVertical: 20 }}>
<TextInput
ref={c => (this._textInput = c)}
onChangeText={inputValue => navigation.setParams({ inputValue })}
style={{
backgroundColor: 'white',
height: 24,
Expand Down
36 changes: 22 additions & 14 deletions examples/NavigationPlayground/js/TabsWithNavigationFocus.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

import React from 'react';
import { SafeAreaView, StatusBar, Text, View } from 'react-native';
import {
createBottomTabNavigator,
withNavigationFocus,
} from 'react-navigation';
import { withNavigationFocus } from 'react-navigation';
import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import { Button } from './commonComponents/ButtonWithMargin';

Expand Down Expand Up @@ -80,16 +78,26 @@ const createTabScreen = (name, icon, focusedIcon, tintColor = '#673ab7') => {
return withNavigationFocus(TabScreen);
};

const TabsWithNavigationFocus = createBottomTabNavigator({
One: {
screen: createTabScreen('One', 'numeric-1-box-outline', 'numeric-1-box'),
},
Two: {
screen: createTabScreen('Two', 'numeric-2-box-outline', 'numeric-2-box'),
},
Three: {
screen: createTabScreen('Three', 'numeric-3-box-outline', 'numeric-3-box'),
const TabsWithNavigationFocus = createMaterialBottomTabNavigator(
{
One: {
screen: createTabScreen('One', 'numeric-1-box-outline', 'numeric-1-box'),
},
Two: {
screen: createTabScreen('Two', 'numeric-2-box-outline', 'numeric-2-box'),
},
Three: {
screen: createTabScreen(
'Three',
'numeric-3-box-outline',
'numeric-3-box'
),
},
},
});
{
shifting: false,
activeTintColor: '#F44336',
}
);

export default TabsWithNavigationFocus;
3 changes: 2 additions & 1 deletion examples/NavigationPlayground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"react-native": "^0.54.0",
"react-native-iphone-x-helper": "^1.0.2",
"react-navigation": "link:../..",
"react-navigation-header-buttons": "^0.0.4"
"react-navigation-header-buttons": "^0.0.4",
"react-navigation-material-bottom-tabs": "0.1.3"
},
"devDependencies": {
"babel-jest": "^22.4.1",
Expand Down
62 changes: 46 additions & 16 deletions examples/NavigationPlayground/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2110,6 +2110,13 @@ create-react-context@^0.2.1:
fbjs "^0.8.0"
gud "^1.0.0"

create-react-context@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.2.tgz#9836542f9aaa22868cd7d4a6f82667df38019dca"
dependencies:
fbjs "^0.8.0"
gud "^1.0.0"

cross-spawn@^5.0.1, cross-spawn@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
Expand Down Expand Up @@ -2220,7 +2227,7 @@ deepmerge@^1.3.0, deepmerge@^1.5.1:
version "1.5.2"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-1.5.2.tgz#10499d868844cdad4fee0842df8c7f6f0c95a753"

deepmerge@^2.0.1:
deepmerge@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.1.0.tgz#511a54fff405fc346f0240bb270a3e9533a31102"

Expand Down Expand Up @@ -5550,6 +5557,10 @@ react-lifecycles-compat@^1.0.2:
version "1.1.4"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-1.1.4.tgz#fc005c72849b7ed364de20a0f64ff58ebdc2009a"

react-lifecycles-compat@^3, react-lifecycles-compat@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.2.tgz#7279047275bd727a912e25f734c0559527e84eff"

react-native-branch@2.0.0-beta.3:
version "2.0.0-beta.3"
resolved "https://registry.yarnpkg.com/react-native-branch/-/react-native-branch-2.0.0-beta.3.tgz#2167af86bbc9f964bd45bd5f37684e5b54965e32"
Expand Down Expand Up @@ -5589,14 +5600,15 @@ react-native-iphone-x-helper@^1.0.2:
babel-plugin-module-resolver "^2.3.0"
babel-preset-react-native "1.9.0"

react-native-paper@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/react-native-paper/-/react-native-paper-1.2.5.tgz#3a4480ca967aae4b3e65a987116973dd012d1fa8"
react-native-paper@=1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/react-native-paper/-/react-native-paper-1.4.0.tgz#33bd477cde1468b63e60bdb0c9a500822d03cdca"
dependencies:
color "^2.0.1"
create-react-context "^0.2.1"
deepmerge "^2.0.1"
create-react-context "^0.2.2"
deepmerge "^2.1.0"
hoist-non-react-statics "^2.5.0"
react-lifecycles-compat "^3.0.2"

react-native-platform-touchable@^1.1.1:
version "1.1.1"
Expand Down Expand Up @@ -5642,9 +5654,9 @@ react-native-svg@6.2.2:
lodash "^4.16.6"
pegjs "^0.10.0"

"react-native-tab-view@github:react-navigation/react-native-tab-view":
react-native-tab-view@^0.0.74:
version "0.0.74"
resolved "https://codeload.github.com/react-navigation/react-native-tab-view/tar.gz/36ebd834d78b841fc19778c966465d02fd1213bb"
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.74.tgz#62c0c882d9232b461ce181d440d683b4f99d1bd8"
dependencies:
prop-types "^15.6.0"

Expand Down Expand Up @@ -5725,26 +5737,44 @@ react-native@^0.54.0:
xmldoc "^0.4.0"
yargs "^9.0.0"

react-navigation-deprecated-tab-navigator@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/react-navigation-deprecated-tab-navigator/-/react-navigation-deprecated-tab-navigator-1.0.1.tgz#a869d749d16116630411d6c7761c51484ba90175"
react-navigation-deprecated-tab-navigator@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/react-navigation-deprecated-tab-navigator/-/react-navigation-deprecated-tab-navigator-1.2.0.tgz#e0d969c196dcd3a4a440770a7bd97fa058eb4aaf"
dependencies:
react-native-tab-view react-navigation/react-native-tab-view
react-native-tab-view "^0.0.74"

react-navigation-header-buttons@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/react-navigation-header-buttons/-/react-navigation-header-buttons-0.0.4.tgz#90dd7617aec31eeb35c600eb90afe40f9b0dc43b"
dependencies:
react-native-platform-touchable "^1.1.1"

react-navigation-tabs@0.1.0-alpha.5:
version "0.1.0-alpha.5"
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.1.0-alpha.5.tgz#51cae3ea5f0f77bdf0deb50a855a5dcaa2f9bf1e"
react-navigation-material-bottom-tabs@0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/react-navigation-material-bottom-tabs/-/react-navigation-material-bottom-tabs-0.1.3.tgz#8e11c3d57ebb72d19adf5e4764390729ed964072"
dependencies:
hoist-non-react-statics "^2.5.0"
prop-types "^15.6.0"
react-native-paper "=1.4.0"
react-navigation-tabs "0.2.0-rc.0"

react-navigation-tabs@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.2.0.tgz#d25be64e01a728c893a93cfeee6b176ab74d67de"
dependencies:
hoist-non-react-statics "^2.5.0"
prop-types "^15.6.0"
react-lifecycles-compat "^1.0.2"
react-native-safe-area-view "^0.7.0"
react-native-tab-view "~0.0.77"

react-navigation-tabs@0.2.0-rc.0:
version "0.2.0-rc.0"
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.2.0-rc.0.tgz#671e8c9914b915796879329752f7240147494038"
dependencies:
hoist-non-react-statics "^2.5.0"
prop-types "^15.6.0"
react-lifecycles-compat "^1.0.2"
react-native-paper "^1.2.5"
react-native-safe-area-view "^0.7.0"
react-native-tab-view "~0.0.77"

Expand Down
4 changes: 0 additions & 4 deletions flow/react-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,10 +809,6 @@ declare module 'react-navigation' {
routeConfigs: NavigationRouteConfigMap,
config?: _TabNavigatorConfig
): NavigationContainer<*, *, *>;
declare export function createMaterialBottomTabNavigator(
routeConfigs: NavigationRouteConfigMap,
config?: _TabNavigatorConfig
): NavigationContainer<*, *, *>;
declare export function createMaterialTopTabNavigator(
routeConfigs: NavigationRouteConfigMap,
config?: _TabNavigatorConfig
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-navigation",
"version": "2.0.0-rc.7",
"version": "2.0.2",
"description": "Routing and navigation for your React Native apps",
"main": "src/react-navigation.js",
"repository": {
Expand Down Expand Up @@ -34,11 +34,11 @@
"hoist-non-react-statics": "^2.2.0",
"path-to-regexp": "^1.7.0",
"prop-types": "^15.5.10",
"react-lifecycles-compat": "^1.0.2",
"react-lifecycles-compat": "^3",
"react-native-drawer-layout-polyfill": "^1.3.2",
"react-native-safe-area-view": "^0.7.0",
"react-navigation-deprecated-tab-navigator": "1.1.0",
"react-navigation-tabs": "0.1.0-alpha.8"
"react-navigation-deprecated-tab-navigator": "1.2.0",
"react-navigation-tabs": "0.2.0"
},
"devDependencies": {
"babel-cli": "^6.24.1",
Expand Down
2 changes: 1 addition & 1 deletion src/StateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const StateUtils = {
* routes of the navigation state, or -1 if it is not present.
*/
indexOf(state, key) {
return state.routes.map(route => route.key).indexOf(key);
return state.routes.findIndex(route => route.key === key);
},

/**
Expand Down
Loading