Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object is not a function (evaluating 'concreteComponentProvider()') in React Native

I'm using wix react native navigation,it works before adding redux.

Navigation.registerComponent('navigation.playground.WelcomeScreen', () => 
AuthScreen);
Navigation.events().registerAppLaunchedListener(() => {
  Navigation.setRoot({
    root: {
      component: {
      name: "navigation.playground.WelcomeScreen"
      }
    }
  });
});

when I add redux,

const store=configureStore()
Navigation.registerComponent('navigation.playground.WelcomeScreen', () => 
AuthScreen,store,Provider);
Navigation.events().registerAppLaunchedListener(() => {
  Navigation.setRoot({
    root: {
      component: {
      name: "navigation.playground.WelcomeScreen"
      }
    }
   });
 });

I'm getting the error Object is not a function(evaluating 'concreteComponentProvider()')

like image 814
Arjun sr Avatar asked Dec 23 '18 14:12

Arjun sr


1 Answers

If you are using the newest version of react-native-navigation, it's probably because you used registerComponent instead of registerComponentWithRedux.

Try changing your code to:

Navigation.registerComponentWithRedux('navigation.playground.WelcomeScreen', () => AuthScreen,Provider,store);

And see if it works.

P.S: In the new version, you have to put the provider before the store.

Source

like image 170
Ray Avatar answered Oct 19 '22 09:10

Ray