【发布时间】:2019-10-18 16:47:54
【问题描述】:
我在底部标签栏的图标组件上呈现了一个徽章。徽章应该与我从屏幕内的异步调用接收到的数据长度相对应。如何向bottomTabNavigator发送异步调用的长度,在屏幕内调用
当 responseJson 返回时,我尝试像这样调度事件:
const setParamsAction = NavigationActions.setParams({
params: { badge: responseJson.length },
});
this.props.navigation.dispatch(setParamsAction);
但是当我从 createMaterialBottomTabBar 中创建路线的导航选项中获取导航参数时,导航状态为空。
【问题讨论】:
标签: react-native react-navigation