Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 to v4 : Route 'myRoute' should declare a screen. #2074

Closed
enguerranws opened this issue Jul 20, 2017 · 6 comments
Closed

v3 to v4 : Route 'myRoute' should declare a screen. #2074

enguerranws opened this issue Jul 20, 2017 · 6 comments

Comments

@enguerranws
Copy link

Hi,

following your advice on #158, I migrated from v3 to v4, I had some issues I fixed, but I'm stuck on this one.

ExceptionsManager.js:63 Route 'splashscreen' should declare a screen. For example:

import MyScreen from './MyScreen';
...
splashscreen: {
  screen: MyScreen,
}

With my Router:

<Router>
               <Scene key="root">

                  <Scene key="splashscreen" component={Splashscreen} title="Splashscreen" initial />
                  <Scene key="login" component={Login} title="Login"/>                            
                  <Scene key="newsfeed" showMainMenu={true} component={Newsfeed} title="Newsfeed" />
                  <Scene key="profile" showMainMenu={true} component={Profile} title="Profile" />
                  <Scene key="jobs" showMainMenu={true} component={Jobs} title="Jobs" />
                
               </Scene>
              
               
              
               
             </Router>

As far as I understand, this comes from StackNavigator, but I thought RNRF was handling this?

@enguerranws enguerranws changed the title v3 to v4 : Cannot read property 'addEventListener' of undefined v3 to v4 : Route 'myRoute' should declare a screen. Jul 20, 2017
@enguerranws
Copy link
Author

I guess I messed up with my Components declaration. MyScreen wasn't referencing to any MyScreen component found in this context.

@gardner
Copy link

gardner commented Jul 28, 2017

I am getting this too. How did you fix it?

@NickBefore
Copy link

NickBefore commented Jul 31, 2017

@peter017
Copy link

I had this issue, fortunately for me it indicated the undefined import statement. I was missing "export" in the imported subcomponent. Therefore the import failed and my was undefined. So first thing, try to check for this. Maybe that helps someone.

@isaackdamian
Copy link

@gardner did you find a fix? I'm currently stuck with the same error

@Blapi
Copy link
Collaborator

Blapi commented Mar 7, 2018

@isaackdamian be sure your Component is a real component, exported and imported correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants