Browse Source

Ability to pass options to Redux Provider (#636)

* Support for ApolloStack

* Pass options to redux Provider
Guns 7 years ago
parent
commit
1ddaaff665
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      src/Navigation.js

+ 4
- 4
src/Navigation.js View File

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