【发布时间】:2018-11-01 10:29:59
【问题描述】:
我想在调用调度操作时在抽屉菜单/导航器上传递一个状态。
<Button
title='Filter'
onPress={() => navigation.dispatch(DrawerActions.openDrawer())}
/>
【问题讨论】:
标签: react-native navigation-drawer
我想在调用调度操作时在抽屉菜单/导航器上传递一个状态。
<Button
title='Filter'
onPress={() => navigation.dispatch(DrawerActions.openDrawer())}
/>
【问题讨论】:
标签: react-native navigation-drawer
您应该调用您的调度函数并使用 this.props.navigation.setParams 设置组件何时挂载
在你的组件中设置调度函数
this.props.navigation.setParams({
dispatch: this.dispatch.bind(this)
})
dispatch(){
//your code
}
【讨论】: