首页 > 其他 > 详细

React Native之router-flex的使用

时间:2016-11-21 19:09:35      阅读:323      评论:0      收藏:0      [点我收藏+]

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的使用

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!