Bladeren bron

Show SideMenu title from passProps

Guy Carmeli 8 jaren geleden
bovenliggende
commit
f531ab0f7a
2 gewijzigde bestanden met toevoegingen van 5 en 2 verwijderingen
  1. 4
    1
      example-redux/src/app.js
  2. 1
    1
      example-redux/src/screens/BottomTabsSideMenu.js

+ 4
- 1
example-redux/src/app.js Bestand weergeven

@@ -150,7 +150,10 @@ export default class App {
150 150
             left: { // optional, define if you want a drawer from the left
151 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 159
         return;

+ 1
- 1
example-redux/src/screens/BottomTabsSideMenu.js Bestand weergeven

@@ -26,7 +26,7 @@ class SideMenu extends Component {
26 26
   render() {
27 27
     return (
28 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 31
         <TouchableOpacity onPress={ this.onShowModalPress.bind(this) }>
32 32
           <Text style={styles.button}>Show modal</Text>