【发布时间】:2022-01-20 21:39:51
【问题描述】:
您好,在 react router dom v5 中,我可以在 redux 中获取参数。示例代码如下:
1-传递参数
<Route path="/saveproduct/:productId" component={AddOrUpdateProduct} />
2- 在 redux 中获取参数。我可以在 ownProps 中获取 productId
function mapStateToProps(state, ownProps) {...
但是当我在 v6 中调用路由时,我无法在 ownProps 中获取 productId
【问题讨论】:
标签: node.js reactjs react-redux react-router-dom