Browse Source

Show SideMenu title from passProps

Guy Carmeli 8 years ago
parent
commit
f531ab0f7a
2 changed files with 5 additions and 2 deletions
  1. 4
    1
      example-redux/src/app.js
  2. 1
    1
      example-redux/src/screens/BottomTabsSideMenu.js

+ 4
- 1
example-redux/src/app.js View File

150
             left: { // optional, define if you want a drawer from the left
150
             left: { // optional, define if you want a drawer from the left
151
               screen: 'example.BottomTabsSideMenu' // unique ID registered with Navigation.registerScreen
151
               screen: 'example.BottomTabsSideMenu' // unique ID registered with Navigation.registerScreen
152
             },
152
             },
153
-            disableOpenGesture: false // optional, can the drawer be opened with a swipe instead of button
153
+            disableOpenGesture: false, // optional, can the drawer be opened with a swipe instead of button
154
+            passProps: {
155
+              title: 'Hello from SideMenu'
156
+            }
154
           }
157
           }
155
         });
158
         });
156
         return;
159
         return;

+ 1
- 1
example-redux/src/screens/BottomTabsSideMenu.js View File

26
   render() {
26
   render() {
27
     return (
27
     return (
28
       <View style={styles.sideMenu}>
28
       <View style={styles.sideMenu}>
29
-        <Text style={styles.title}>Hello from SideMenu</Text>
29
+        <Text style={styles.title}>{this.props.title}</Text>
30
 
30
 
31
         <TouchableOpacity onPress={ this.onShowModalPress.bind(this) }>
31
         <TouchableOpacity onPress={ this.onShowModalPress.bind(this) }>
32
           <Text style={styles.button}>Show modal</Text>
32
           <Text style={styles.button}>Show modal</Text>