With react-router you can transfer "state"(使用react-router,您可以传输“状态”)
this.props.history.push({
pathname: '/ShowRecommendation',
state: { taskid: Task_id }
})
and at the ShowRecommendation.js componenet you can get the value using(在ShowRecommendation.js组件上,您可以使用)
console.log(this.props.location.state)
Comment if you have more questions(如果您还有其他问题请发表评论) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…