【发布时间】:2020-02-22 14:56:23
【问题描述】:
我在 react-native 中使用 react-native-router-flux 进行导航。
我的标签使用具有不同道具的相同组件。第一个选项卡更改时一切正常,但返回相同选项卡时道具没有更改。
返回同一个标签应该使用什么方法?
App.js
<Scene key="root" hideNavBar={true}>
<Scene key="rootTabBar" tabs={true} hideNavBar={true}>
<Scene
key="firstCaregory"
title="First Category"
id={1}
component={Category}
/>
<Scene
key="secondCategory"
title="Second Category"
id={2}
component={Category}
/>
</Scene>
</Scene>
类别.js
componentDidMount() {
this.props.fetchNews(this.props.id);
}
【问题讨论】:
标签: reactjs react-native react-redux react-native-router-flux