反应本机导航中的导航器

Navigator in react-native-navigation

 Navigation.setRoot({
      root: {
        stack: {
          children: [s
            {
              component: {
                name: `Danapay.${screen}`,
                passProps: {},
              },
            },
          ],
        },
      },
    });

通过 TypeError: null is not an object (evaluating 'this.nativeCommandsModule.setRoot') in react native navigation

可能是您的代码输入错误造成的:

       stack: {
          children: [s // <-- This should not be here
            {
              component: {
                name: `Danapay.${screen}`,
                passProps: {},
              },
            },
          ],
        },