Skip to content

Commit

Permalink
[Fix #3194] Adjust reset to work with nested routes
Browse files Browse the repository at this point in the history
  • Loading branch information
daviscabral committed Sep 3, 2018
1 parent bb2e5bb commit 9a27f0e
Show file tree
Hide file tree
Showing 17 changed files with 703 additions and 492 deletions.
3 changes: 3 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
"extends": "./babel.config.js"
};
5 changes: 3 additions & 2 deletions Example/Example.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Example = () => (
<Lightbox key="lightbox">
<Stack hideNavBar key="root" titleStyle={{ alignSelf: 'center' }}>
<Scene key="echo" back clone component={EchoView} getTitle={({ navigation }) => navigation.state.key} />
<Scene key="launch" component={Launch} title="Launch" initial />
<Scene key="launch" component={Launch} title="Launch" initial type={ActionConst.RESET} />

<Stack key="customNavBar" hideTabBar titleStyle={{ alignSelf: 'center' }}>
<Scene key="customNavBar1" title="CustomNavBar 1" navBar={CustomNavBar} component={CustomNavBarView} back />
Expand All @@ -86,6 +86,7 @@ const Example = () => (
<Scene hideNavBar panHandlers={null}>
<Tabs
key="tabbar"
routeName="tabbar"
backToInitial
swipeEnabled
showLabel={false}
Expand Down Expand Up @@ -114,7 +115,7 @@ const Example = () => (
</Stack>

<Stack key="tab_3" icon={TabIcon} title="Tab #3">
<Scene key="tab_3_1" component={TabView} rightTitle="Right3" onRight={() => {}} />
<Scene key="tab_3_1" component={TabView} rightTitle="Reset to 'tabbar'" onRight={() => Actions.reset('tabbar')} />
</Stack>
<Scene key="tab_4_1" component={TabView} title="Tab #4" hideNavBar icon={TabIcon} />
<Stack key="tab_5" icon={TabIcon} title="Tab #5">
Expand Down
1 change: 1 addition & 0 deletions Example/components/drawer/DrawerContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class DrawerContent extends React.Component {
Switch to tab5 with data
</Button>
<Button onPress={Actions.echo}>Push Clone Scene (EchoView)</Button>
<Button onPress={Actions.launch}>Reset back to launch</Button>
</View>
);
}
Expand Down
17 changes: 9 additions & 8 deletions Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,27 @@
"*/@babel/cli": "7.0.0-beta.47",
"*/@babel/core": "7.0.0-beta.47",
"*/@babel/code-frame": "7.0.0-beta.47",
"*/@babel/highlight": "7.0.0-beta.47",
"*/babel-core": "7.0.0-bridge.0"
"*/@babel/generator": "7.0.0-beta.47",
"*/@babel/highlight": "7.0.0-beta.47"
},
"dependencies": {
"prop-types": "^15.6.2",
"react": "^16.4.1",
"react-native": "^0.56.0",
"react": "16.4.1",
"react-native": "0.56.0",
"react-native-button": "^2.3.0",
"react-native-message-bar": "^2.0.10",
"react-native-router-flux": "file:..",
"react-navigation": "^2.12.1"
"react-navigation": "2.12.x"
},
"devDependencies": {
"@babel/code-frame": "7.0.0-beta.47",
"@babel/core": "7.0.0-beta.47",
"@babel/plugin-proposal-decorators": "7.0.0-beta.47",
"autobind-decorator": "^2.1.0",
"babel-core": "^7.0.0-0",
"babel-jest": "^23.4.2",
"babel-preset-react-native": "^5.0.2",
"jest": "^23.5.0",
"babel-jest": "^23.4.0",
"babel-preset-react-native": "5.0.2",
"jest": "^23.4.1",
"react-test-renderer": "^16.4.2"
},
"jest": {
Expand Down

0 comments on commit 9a27f0e

Please sign in to comment.