码迷,mamicode.com
首页 > 其他好文 > 详细

React Native之router-flex的使用

时间:2016-11-21 19:12:50      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:selector   ops   code   tabbar   switch   否则   nec   nes   登录   

1.Switch

必须要使用tabs={true},否则会找不到unloginCenter的错误

<Scene
                            key="switch"
                            component={connect(state=>({login:state.loginReducer.login}))(Switch)}
                            title={Consts.UserCenterPage}
                            tabs={true}
                            unmountScenes
                            // hideOnChildTabs
                            selector={props=>props.login?tabbar:unloginCenter}
                        >
    <Scene key="tabbar" />
    <Scene key="unloginCenter" />
</Scene>

使用unmountScenes

执行顺序:

tabbar

unloginCenter
unloginCenter
-----登录
tabbar

不使用unmountScenes
unloginCenter
unloginCenter
-----登录
tabbar
tabbar

React Native之router-flex的使用

标签:selector   ops   code   tabbar   switch   否则   nec   nes   登录   

原文地址:http://www.cnblogs.com/yz1311/p/6086234.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!