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

Route 'key0' should declare a screen. For example #2835

Closed
felixzxk opened this issue Jan 26, 2018 · 9 comments
Closed

Route 'key0' should declare a screen. For example #2835

felixzxk opened this issue Jan 26, 2018 · 9 comments
Labels
v3 or v4.0.0-beta Related to an unsupported version

Comments

@felixzxk
Copy link

felixzxk commented Jan 26, 2018

Version

  • react-native-router-flux v4.0.0-beta.28
  • react-native v0.52.1

Actual behaviour

throw error like below:

Unhandled JS Exception: Error: Route 'key0' should declare a screen. For example:

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

Expected behaviour

then I import all business components into the entry file, and combine them into wrap, it works, but I want organize my route in each business module, and export some module files, combine them in entry file finally.

sorry i'm not good at �English.

please give me a hand, I can't thank you any more

Steps to reproduce

I export some Components from my business modules like below:

mm01.js

(...some imports gose here)
export default class MM01 extends Component{
  render(){
    return (
      <Scene key="myModule01" initial tabs>
          <Scene key="myModule010" initial component={MM010}>
          <Scene key="myModule011" component={MM011}>
          <Scene key="myModule012" component={MM012}>
          <Scene key="myModule013" component={MM013}>
      </Scene>
    );
  }
}

mm02.js

(...some imports gose here)
export default class MM02 extends Component{
  render(){
    return (
      <Scene key="myModule02">
          <Scene key="myModule020" initial component={MM020}>
          <Scene key="myModule021" component={MM021}>
      </Scene>
    );
  }
}

entry.js like below:

(...some imports gose here) 
class App extends Component {
    return (
      <Router>
          <Scene key="root">
              <MM01 />
              <MM02 />
          </Scene>
      </Router>
    );
}
AppRegistry.registerComponent('rnMbox', () => App);
@wulala
Copy link

wulala commented Feb 7, 2018

https://github.com/aksonov/react-native-router-flux/blob/v4/docs/OTHER_INFO.md#split-your-scenes-to-smaller-parts-if-needed

It works for me.

@felixzxk
Copy link
Author

felixzxk commented Feb 8, 2018

@wulala 谢谢

@felixzxk felixzxk closed this as completed Feb 8, 2018
@isaackdamian
Copy link

@felixzxk Did you find a fix? Please help i'm having the same problem.

@felixzxk
Copy link
Author

@taichi-jp
Copy link

How to use Component to divide routers?

@Sushant-Sardeshpande
Copy link

Getting the same error as well with beta 31, the v3 method no longer works and the link above throws a 404 error

@uguraktas
Copy link

is this problem still going on ?

@hussainwali74
Copy link

seriously ! please don't write packages if you can't maintain them, fix the issues

@daviscabral
Copy link
Collaborator

v3 and beta are not supported.

Repository owner locked as too heated and limited conversation to collaborators Sep 30, 2018
@daviscabral daviscabral added the v3 or v4.0.0-beta Related to an unsupported version label Sep 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
v3 or v4.0.0-beta Related to an unsupported version
Projects
None yet
Development

No branches or pull requests

8 participants