我有一个类似的反应路由器事件
//src/App/components/common/Notifications
onCommentClick = (id) => {
this.props.history.push(`/dashboard/${id}`)
}
它将更改浏览器的网址,我想我的路由设置正确
//src/App/containers/dashboard/user/NotificationDetail
但是问题是redux似乎没有重新渲染我的容器组件,我需要刷新以获取正确的内容。
来源https://github.com/thian4/hoc-redux
坚持1天找不到解决办法。
答案 0 :(得分:-1)
代替此->
react-native-windows
使用@withRouter
@connect(state => state.global, {
getNotifications
})
->
mapStateToProps()
只要您的redux状态更新,它将重新渲染您的组件。