File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,21 @@ const getSceneStyle = () => ({
6262// on Android, the URI prefix typically contains a host in addition to scheme
6363const prefix = Platform . OS === 'android' ? 'mychat://mychat/' : 'mychat://' ;
6464
65+ const onBackPress = ( ) => {
66+ if ( Actions . state . index !== 0 ) {
67+ return false
68+ }
69+ Actions . pop ( )
70+ return true
71+ }
72+
6573const Example = ( ) => (
6674 < Router
6775 createReducer = { reducerCreate }
6876 getSceneStyle = { getSceneStyle }
6977 uriPrefix = { prefix }
70- >
78+ backAndroidHandler = { onBackPress } >
79+
7180 < Overlay key = "overlay" >
7281 < Modal key = "modal"
7382 hideNavBar
@@ -130,6 +139,9 @@ const Example = () => (
130139 contentComponent = { DrawerContent }
131140 drawerImage = { MenuIcon }
132141 drawerWidth = { 300 }
142+ drawerOpenRoute = 'DrawerOpen'
143+ drawerCloseRoute = 'DrawerClose'
144+ drawerToggleRoute = 'DrawerToggle'
133145 >
134146 { /*
135147 Wrapper Scene needed to fix a bug where the tabs would
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ class DrawerContent extends React.Component {
2929 render ( ) {
3030 return (
3131 < View style = { styles . container } >
32- < Text > Drawer Content</ Text >
33- < Button onPress = { Actions . closeDrawer } > Back</ Button >
32+ { /* <Text>Drawer Content</Text>
33+ <Button onPress={Actions.closeDrawer}>Back</Button> */ }
3434 < Text > Title: { this . props . title } </ Text >
3535 { this . props . name === 'tab1_1' &&
3636 < Button onPress = { Actions . tab_1_2 } > next screen for tab1_1</ Button >
You can’t perform that action at this time.
0 commit comments