react-navigation-helper
安装
yarn add react-navigator-helper 或 npm install --save react-navigator-helper
怎么使用?
RootView <RootView ref= { NavigatorPush; }/> //保存navigator的引用NavigatorPush; //跳转路由 TestPage ;;; @withMappedNavigationProps@observer { NavigatorPush; //当前路由设置参数 console; } { const userName pwdtestnavigation = thisprops; console; console; return <View style=flex:1> <StatusBar hidden=false barStyle='dark-content' translucent=false backgroundColor='white'/> </View> ; }
解释一下
如果你使用了mobx的observer注解,解决办法就是把@observer放下面,以免mobx失效。