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
       screen: 'example.SecondSideMenu' // unique ID registered with Navigation.registerScreen
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
   animationType: 'slide-down' // optional, add transition animation to root change: 'none', 'slide-down', 'fade'
156
   animationType: 'slide-down' // optional, add transition animation to root change: 'none', 'slide-down', 'fade'
156
 });
157
 });
157
 ```
158
 ```
175
       screen: 'example.SecondSideMenu' // unique ID registered with Navigation.registerScreen
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
   animationType: 'slide-down' // optional, add transition animation to root change: 'none', 'slide-down', 'fade'
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
     }
76
     }
77
   });
77
   });
78
   ControllerRegistry.registerController(controllerID, () => Controller);
78
   ControllerRegistry.registerController(controllerID, () => Controller);
79
-  ControllerRegistry.setRootController(controllerID, params.animationType);
79
+  ControllerRegistry.setRootController(controllerID, params.animationType, params.passProps || {});
80
 }
80
 }
81
 
81
 
82
 function startSingleScreenApp(params) {
82
 function startSingleScreenApp(params) {
134
     }
134
     }
135
   });
135
   });
136
   ControllerRegistry.registerController(controllerID, () => Controller);
136
   ControllerRegistry.registerController(controllerID, () => Controller);
137
-  ControllerRegistry.setRootController(controllerID, params.animationType);
137
+  ControllerRegistry.setRootController(controllerID, params.animationType, params.passProps || {});
138
 }
138
 }
139
 
139
 
140
 function _mergeScreenSpecificSettings(screenID, screenInstanceID, params) {
140
 function _mergeScreenSpecificSettings(screenID, screenInstanceID, params) {