1,引入Link模塊
import { NavLink as Link } from 'react-router-dom'
2,Link標簽中帶上要傳遞的參數
<Link to={
{
pathname:`/要跳轉的路徑`,
state:{key值:val值}
}
}>
3,在跳轉頁面接收傳遞的參數
componentWillMount(){
//console.log(this.props.location)//傳遞過來的所有參數
console.log(this.props.location.state.key值)//val值
}
