react-native-router-flux(一)
2016-08-31 09:35
1361 查看
navigator with redux react native
for
在采用了redux的项目中实现navigator的跳转。采用 react-native-router-flux +reduxexplain
在Route标签中的component属性将redux加入组件中,
在Router标签中Connect a to redux
triggeractions
Actions.BEFORE_ROUTE
Actions.AFTER_ROUTE
Actions.AFTER_POP
Actions.BEFORE_POP
Actions.AFTER_DISMISS
Actions.BEFORE_DISMISS
在reducer中state.set(‘currentRoute’,action.name)
update you component on focus
componentDidUpdate(prevProps) { const prevRoute = prevProps.global.currentRoute const currentRoute = this.props.global.currentRoute if (currentRoute === 'payment' && prevRoute !== currentRoute) { this.props.actions.doSomething() } }
ref
http://stackoverflow.com/questions/35140116/accessing-navigator-in-actions-with-react-native-and-reduxlast update 2016-08-31
相关文章推荐
- react-native 路由 react-native-router-flux
- (React-Native 学习之六) react-native-router-flux 组件学习(页面间的跳转)
- react-native 基础:react-native-router-flux 的使用[意译]
- react-native-router-flux使用技巧
- ReactNative React-native-router-flux框架---刷新当前页面的属性
- react-native-router-flux 使用详解(三)
- react-native-router-flux 使用详解(二)
- react-native-router-flux 使用详解(一)
- react-native-router-flux 使用详解(一)
- react_native_router_flux_使用详解(二)
- react-native-router-flux 使用详解(三)
- react-native-router-flux 使用详解(三)
- react-native-router-flux popTo('想pop到的scene') 回退多级不能实现问题
- ReactNative之Flux框架的使用
- react-native使用flux
- 《ReactNative实战讲义》React-native-router-flux框架篇---页面跳转与传值
- 《ReactNative实战讲义》react-native-router-flux框架篇---刷新当前页面的属性
- ReactNative Flux框架使用 基础篇
- React Native + Flux
- ReactNative Flux框架使用 进阶篇