From 56637442e43eb52349fb1a3be03ad145d4418ec2 Mon Sep 17 00:00:00 2001 From: "Davis Z. Cabral" Date: Fri, 21 Sep 2018 18:56:00 -0300 Subject: [PATCH] Closes #3267 #3258: Fix replace and issues with refresh (#3269) --- examples/expo/package.json | 3 +++ examples/react-native/components/TabView.js | 7 +++++++ examples/react-native/package.json | 6 ++++++ examples/react-native/yarn.lock | 4 ++-- examples/redux/package.json | 5 +++++ src/navigationStore.js | 2 +- 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/examples/expo/package.json b/examples/expo/package.json index b1823aed7..80d5797b5 100644 --- a/examples/expo/package.json +++ b/examples/expo/package.json @@ -6,6 +6,9 @@ "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", + "dev:ios": "yarn dev && yarn ios", + "dev:android": "yarn dev && yarn android", + "dev": "cp ../../src/* node_modules/react-native-router-flux/src/", "eject": "expo eject", "lint": "yarn run eslint **/*.js", "fix": "yarn run eslint **/*.js --fix", diff --git a/examples/react-native/components/TabView.js b/examples/react-native/components/TabView.js index b33f5932f..c8ac97f7e 100644 --- a/examples/react-native/components/TabView.js +++ b/examples/react-native/components/TabView.js @@ -102,6 +102,13 @@ class TabView extends React.Component { > Toggle NavBar + {this.props.name === 'tab_2_1' && ( )} diff --git a/examples/react-native/package.json b/examples/react-native/package.json index 38892262b..a77a7b027 100644 --- a/examples/react-native/package.json +++ b/examples/react-native/package.json @@ -4,6 +4,12 @@ "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", + "dev:start": "yarn dev && yarn start", + "ios": "react-native run-ios", + "android": "react-native run-android", + "dev:ios": "yarn dev && yarn ios", + "dev:android": "yarn dev && yarn android", + "dev": "cp ../../src/* node_modules/react-native-router-flux/src/", "test": "jest", "postinstall": "node_modules/.bin/rnrf dedup" }, diff --git a/examples/react-native/yarn.lock b/examples/react-native/yarn.lock index 077ce05d6..f99358865 100644 --- a/examples/react-native/yarn.lock +++ b/examples/react-native/yarn.lock @@ -4449,12 +4449,12 @@ react-native-message-bar@^2.0.10: version "2.0.10" resolved "https://registry.yarnpkg.com/react-native-message-bar/-/react-native-message-bar-2.0.10.tgz#34632bdf2cbfe0f51ae4f1e9a91c42b4394a11c2" -"react-native-router-flux-cli@file:../packages/react-native-router-flux-cli": +"react-native-router-flux-cli@file:../../packages/react-native-router-flux-cli": version "0.0.1" dependencies: rimraf "^2.6.2" -"react-native-router-flux@file:..": +"react-native-router-flux@file:../..": version "4.0.2-dev" dependencies: lodash.isequal "4.5.0" diff --git a/examples/redux/package.json b/examples/redux/package.json index 665399935..bc620e562 100644 --- a/examples/redux/package.json +++ b/examples/redux/package.json @@ -4,6 +4,11 @@ "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", + "ios": "react-native run-ios", + "android": "react-native run-android", + "dev:ios": "yarn dev && yarn ios", + "dev:android": "yarn dev && yarn android", + "dev": "cp ../../src/* node_modules/react-native-router-flux/src/", "test": "jest", "postinstall": "./node_modules/.bin/rnrf dedup" }, diff --git a/src/navigationStore.js b/src/navigationStore.js index 33f316fb5..0ee585a61 100644 --- a/src/navigationStore.js +++ b/src/navigationStore.js @@ -350,7 +350,7 @@ function createNavigationOptions(params) { res.tabBarOnPress = (data) => { if (userDefinedTabBarOnPress) { console.warn('backToInitial and tabBarOnPress were both defined and might cause unexpected navigation behaviors. I hope you know what you are doing ;-)'); - userDefinedTabBarOnPress(scene, jumpToIndex); + userDefinedTabBarOnPress(data); } if (data.navigation && data.navigation.state.index !== 0) { data.navigation.dispatch(StackActions.popToTop());