React-native-navigation: Component [name] does not have a componentId

Created on 16 Jan 2019  ·  11Comments  ·  Source: wix/react-native-navigation

Issue Description

I followed all steps on https://wix.github.io/react-native-navigation/#/docs/Installing?id=ios and created the _index.js_ file like the tutorial describes.
Now Navigation.registerComponent("Name", () => Main); causes the error:

Component [Name] does not have a componentId

Main is a simple React component.

Environment

  • React Native Navigation version: 2.7.0
  • React Native version: 0.57.8
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): iPhone7 with iOS 12.1.2
🏚 stale

Most helpful comment

Anything new regarding this. I have a new project, initialized with the react-native tutorial and I am trying to get react-native-navigation to work but it still fails.

import { Navigation } from "react-native-navigation";
import App from './App';


Navigation.registerComponent(`FamilyMealOrganizer`, () => App);

Navigation.events().registerAppLaunchedListener(() => {
  Navigation.setRoot({
    root: {
      component: {
        name: "FamilyMealOrganizer"
      }
    }
  });
});

I get exactly the same error.

Work around does not work.

All 11 comments

Same here. Did you find a solution?

@JoseFMP I also tried to do it with cocoapods but it did not work.
Ended up not using this library. Instead I now use FluidTransitions with React Navigation.

Such a pity... I really want to use react-native-navigation because as opposed to React Navigation, it uses native APIs. But this issue is just blocking.

@IL4Miy
I found out a workaround... if you issue

    AppRegistry.registerComponent('appname', ()  => Component );

before calling Navigation.registerComponent it seems to work. No clue why though.

Encountered the same issue here while following the official documentation 🤣 . That workaround did not work for me. Looks like I will have to stick with React-Navigation for now.

Update: Worked for me after passing in componentId manually.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

The issue has been closed for inactivity.

Anything new regarding this. I have a new project, initialized with the react-native tutorial and I am trying to get react-native-navigation to work but it still fails.

import { Navigation } from "react-native-navigation";
import App from './App';


Navigation.registerComponent(`FamilyMealOrganizer`, () => App);

Navigation.events().registerAppLaunchedListener(() => {
  Navigation.setRoot({
    root: {
      component: {
        name: "FamilyMealOrganizer"
      }
    }
  });
});

I get exactly the same error.

Work around does not work.

I faced the same issue because I missed steps 3 and 3b from Native Installation section.

faced same issue (((

If anybody is experiencing this issue with rnn v7 please open a new issue and provide a reproducible demo.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

charlesluo2014 picture charlesluo2014  ·  3Comments

zhanguangao picture zhanguangao  ·  3Comments

EliSadaka picture EliSadaka  ·  3Comments

edcs picture edcs  ·  3Comments

bdrobinson picture bdrobinson  ·  3Comments