对象不是 React Native 中的函数(求值 'concreteComponentProvider()')

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

我正在使用 wix react 本机导航,在添加 redux 之前它可以工作。

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

当我添加 redux 时,

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

我收到错误 Object is not a function(evaluating 'concreteComponentProvider()')

如果您使用的是最新版本的 react-native-navigation,可能是因为您使用了 registerComponent 而不是 registerComponentWithRedux

尝试将您的代码更改为:

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

看看它是否有效。

P.S: 新版本必须把provider放在store之前

Source