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

Improve JSX syntax for built-in containers #2210

Closed
aksonov opened this issue Aug 10, 2017 · 1 comment
Closed

Improve JSX syntax for built-in containers #2210

aksonov opened this issue Aug 10, 2017 · 1 comment

Comments

@aksonov
Copy link
Owner

aksonov commented Aug 10, 2017

Currently Router accepts only one type of children - Scene (actually it doesn't check element name at all now). It makes very complex structures hard to maintain and modify - you will see just numerous </Scene></Scene>...</Scene> - it is difficult to insert new scene into 'middle' of some element.

I propose to add new types for built-in containers - Stack, Tabs, Lightbox and use Scene for child only. It will allow to make JSX more user-friendly:

   <Stack key='root'>
        <Tabs key='tabbar'>
              <Stack key='tab1'>
                 <Scene key='tab1_1' component={Tab1_1}/>
                 <Scene key='tab1_2' component={Tab1_2}/>
              </Stack> 
              <Scene key='tab2' component={Tab2}/>
        </Tabs>
   </Stack>
@aksonov
Copy link
Owner Author

aksonov commented Aug 14, 2017

Also I made key optional.

@aksonov aksonov closed this as completed Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant