react-native - 对象不是 React Native 中的函数(评估 'concreteComponentProvider()' )

标签 react-native redux wix-react-native-navigation

我正在使用 wix react native 导航,它在添加 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:在新版本中,您必须将提供者放在商店之前。

Source

关于react-native - 对象不是 React Native 中的函数(评估 'concreteComponentProvider()' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53904531/

相关文章:

react-native-navigation - 如何在 Android 中将 React native 导航与 AWS Amplify 推送通知集成?

react-native - Wix React-Native-Navigation : onPress for custom component button

javascript - 为什么 mapStateToProps 在状态发生变化时返回空对象?

reactjs - React Native 在打开时刷新一个组件

javascript - MobX 存储在 React Native 中未更新

javascript - Touchableopacity onpress 在 SVG 标签内不起作用

javascript - 给定操作 "X",reducer "Y"返回未定义

javascript - setState 只能更新一个已挂载或挂载的组件

android - 在Android上使用react-native-splash screen和react-native-navigation

ios - Xcode 12 - 没有要编译的架构(ONLY_ACTIVE_ARCH=YES,active arch=x86_64,VALID_ARCHS=arm64e armv7s arm64 arm7)