Skip to content

Commit

Permalink
Closes #3267 #3258: Fix replace and issues with refresh (#3269)
Browse files Browse the repository at this point in the history
  • Loading branch information
daviscabral authored Sep 21, 2018
1 parent 0f6cc9b commit 5663744
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
3 changes: 3 additions & 0 deletions examples/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions examples/react-native/components/TabView.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ class TabView extends React.Component {
>
Toggle NavBar
</Button>
<Button
onPress={() => {
Actions.replace('tab_2_1')
}}
>
Replace with tab2
</Button>
{this.props.name === 'tab_2_1' && (
<Button onPress={this.toggleTabBar}>Toggle TabBar</Button>
)}
Expand Down
6 changes: 6 additions & 0 deletions examples/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/react-native/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions examples/redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion src/navigationStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 5663744

Please sign in to comment.