Browse Source

support passProps in startTabBasedApp and startSingleScreenApp

talkol 8 years ago
parent
commit
abb171a7e6
2 changed files with 4 additions and 2 deletions
  1. 2
    0
      README.md
  2. 2
    2
      src/platformSpecific.ios.js

+ 2
- 0
README.md View File

@@ -152,6 +152,7 @@ Navigation.startTabBasedApp({
152 152
       screen: 'example.SecondSideMenu' // unique ID registered with Navigation.registerScreen
153 153
     }
154 154
   },
155
+  passProps: {}, // simple serializable object that will pass as props to all top screens (optional)
155 156
   animationType: 'slide-down' // optional, add transition animation to root change: 'none', 'slide-down', 'fade'
156 157
 });
157 158
 ```
@@ -175,6 +176,7 @@ Navigation.startSingleScreenApp({
175 176
       screen: 'example.SecondSideMenu' // unique ID registered with Navigation.registerScreen
176 177
     }
177 178
   },
179
+  passProps: {}, // simple serializable object that will pass as props to all top screens (optional)
178 180
   animationType: 'slide-down' // optional, add transition animation to root change: 'none', 'slide-down', 'fade'
179 181
 });
180 182
 ```

+ 2
- 2
src/platformSpecific.ios.js View File

@@ -76,7 +76,7 @@ function startTabBasedApp(params) {
76 76
     }
77 77
   });
78 78
   ControllerRegistry.registerController(controllerID, () => Controller);
79
-  ControllerRegistry.setRootController(controllerID, params.animationType);
79
+  ControllerRegistry.setRootController(controllerID, params.animationType, params.passProps || {});
80 80
 }
81 81
 
82 82
 function startSingleScreenApp(params) {
@@ -134,7 +134,7 @@ function startSingleScreenApp(params) {
134 134
     }
135 135
   });
136 136
   ControllerRegistry.registerController(controllerID, () => Controller);
137
-  ControllerRegistry.setRootController(controllerID, params.animationType);
137
+  ControllerRegistry.setRootController(controllerID, params.animationType, params.passProps || {});
138 138
 }
139 139
 
140 140
 function _mergeScreenSpecificSettings(screenID, screenInstanceID, params) {