ghkatende
ghkatende

Reputation: 487

Navigator in react-native-navigation

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

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

Upvotes: 0

Views: 127

Answers (1)

Rapsssito
Rapsssito

Reputation: 150

It may be caused by a typo in your code:

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

Upvotes: 1

Related Questions