Skip to content

Commit 5663744

Browse files
authored
Closes #3267 #3258: Fix replace and issues with refresh (#3269)
1 parent 0f6cc9b commit 5663744

File tree

6 files changed

+24
-3
lines changed

6 files changed

+24
-3
lines changed

examples/expo/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"start": "expo start",
77
"android": "expo start --android",
88
"ios": "expo start --ios",
9+
"dev:ios": "yarn dev && yarn ios",
10+
"dev:android": "yarn dev && yarn android",
11+
"dev": "cp ../../src/* node_modules/react-native-router-flux/src/",
912
"eject": "expo eject",
1013
"lint": "yarn run eslint **/*.js",
1114
"fix": "yarn run eslint **/*.js --fix",

examples/react-native/components/TabView.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ class TabView extends React.Component {
102102
>
103103
Toggle NavBar
104104
</Button>
105+
<Button
106+
onPress={() => {
107+
Actions.replace('tab_2_1')
108+
}}
109+
>
110+
Replace with tab2
111+
</Button>
105112
{this.props.name === 'tab_2_1' && (
106113
<Button onPress={this.toggleTabBar}>Toggle TabBar</Button>
107114
)}

examples/react-native/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
"private": true,
55
"scripts": {
66
"start": "node node_modules/react-native/local-cli/cli.js start",
7+
"dev:start": "yarn dev && yarn start",
8+
"ios": "react-native run-ios",
9+
"android": "react-native run-android",
10+
"dev:ios": "yarn dev && yarn ios",
11+
"dev:android": "yarn dev && yarn android",
12+
"dev": "cp ../../src/* node_modules/react-native-router-flux/src/",
713
"test": "jest",
814
"postinstall": "node_modules/.bin/rnrf dedup"
915
},

examples/react-native/yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4449,12 +4449,12 @@ react-native-message-bar@^2.0.10:
44494449
version "2.0.10"
44504450
resolved "https://registry.yarnpkg.com/react-native-message-bar/-/react-native-message-bar-2.0.10.tgz#34632bdf2cbfe0f51ae4f1e9a91c42b4394a11c2"
44514451

4452-
"react-native-router-flux-cli@file:../packages/react-native-router-flux-cli":
4452+
"react-native-router-flux-cli@file:../../packages/react-native-router-flux-cli":
44534453
version "0.0.1"
44544454
dependencies:
44554455
rimraf "^2.6.2"
44564456

4457-
"react-native-router-flux@file:..":
4457+
"react-native-router-flux@file:../..":
44584458
version "4.0.2-dev"
44594459
dependencies:
44604460
lodash.isequal "4.5.0"

examples/redux/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"private": true,
55
"scripts": {
66
"start": "node node_modules/react-native/local-cli/cli.js start",
7+
"ios": "react-native run-ios",
8+
"android": "react-native run-android",
9+
"dev:ios": "yarn dev && yarn ios",
10+
"dev:android": "yarn dev && yarn android",
11+
"dev": "cp ../../src/* node_modules/react-native-router-flux/src/",
712
"test": "jest",
813
"postinstall": "./node_modules/.bin/rnrf dedup"
914
},

src/navigationStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function createNavigationOptions(params) {
350350
res.tabBarOnPress = (data) => {
351351
if (userDefinedTabBarOnPress) {
352352
console.warn('backToInitial and tabBarOnPress were both defined and might cause unexpected navigation behaviors. I hope you know what you are doing ;-)');
353-
userDefinedTabBarOnPress(scene, jumpToIndex);
353+
userDefinedTabBarOnPress(data);
354354
}
355355
if (data.navigation && data.navigation.state.index !== 0) {
356356
data.navigation.dispatch(StackActions.popToTop());

0 commit comments

Comments
 (0)