Explorar el Código

Ability to pass options to Redux Provider (#636)

* Support for ApolloStack

* Pass options to redux Provider
Guns hace 7 años
padre
commit
1ddaaff665
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4
    4
      src/Navigation.js

+ 4
- 4
src/Navigation.js Ver fichero

@@ -14,9 +14,9 @@ function registerScreen(screenID, generator) {
14 14
   AppRegistry.registerComponent(screenID, generator);
15 15
 }
16 16
 
17
-function registerComponent(screenID, generator, store = undefined, Provider = undefined) {
17
+function registerComponent(screenID, generator, store = undefined, Provider = undefined, options = {}) {
18 18
   if (store && Provider) {
19
-    return _registerComponentRedux(screenID, generator, store, Provider);
19
+    return _registerComponentRedux(screenID, generator, store, Provider, options);
20 20
   } else {
21 21
     return _registerComponentNoRedux(screenID, generator);
22 22
   }
@@ -57,7 +57,7 @@ function _registerComponentNoRedux(screenID, generator) {
57 57
   return generatorWrapper;
58 58
 }
59 59
 
60
-function _registerComponentRedux(screenID, generator, store, Provider) {
60
+function _registerComponentRedux(screenID, generator, store, Provider, options) {
61 61
   const generatorWrapper = function() {
62 62
     const InternalComponent = generator();
63 63
     return class extends Screen {
@@ -79,7 +79,7 @@ function _registerComponentRedux(screenID, generator, store, Provider) {
79 79
 
80 80
       render() {
81 81
         return (
82
-          <Provider store={store}>
82
+          <Provider store={store} {...options}>
83 83
             <InternalComponent testID={screenID} navigator={this.navigator} {...this.state.internalProps} />
84 84
           </Provider>
85 85
         );