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

Allow 1-deep nested arrays of Scenes to support structured configuration for larger projects #2241

Merged
merged 2 commits into from
Aug 16, 2017

Conversation

davojan
Copy link
Contributor

@davojan davojan commented Aug 15, 2017

For larger projects it is convenient to divide scenes configuration by modules. If the new module needs it's own navigator this is ok, but often you just want to configure some more screens for the existing top-level stack navigator. In v3 that was achievable via explicitly adding array of childrens of sub-module config:

// app/scenes.jsx
<Scene key="root">
  {submodule1Scenes.props.children}
  {submodule2Scenes.props.children}
</Scene>

// submodule1/scenes.jsx
submodule1Scenes = (
  <Scene>
     <Scene key="/test" component={Test}/>
     <Scene key="/test1" component={Test1}/>
  </Scene>
)

This was ugly but workable solution. v4 throws exception for such trick and doesn't provide any alternative solution. This small change allows such trick and makes v4 more compatible with v3 configuration.

Better solution would be to introduce a new configuration node (may be call it <Group></Group>) to contain sub-module configuration without introducing new sub-navigator.

P.S.: Unfortunately I'm unable to commit dist files because npm run build doesn't work for me (#2240). But I've tested this by altering dist code manually.

@mention-bot
Copy link

@davojan, thanks for your PR! By analyzing the history of the files in this pull request, we identified @aksonov to be a potential reviewer.

@aksonov aksonov merged commit 63ab0ea into aksonov:master Aug 16, 2017
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

Successfully merging this pull request may close these issues.

3 participants