react-router中withRouter的做用

react-router中withRouter的做用 withRouter是react-router的一個高階組件,可獲取historyreact render時會把match, location和history傳入propsnpm react中通過路由渲染的組件才擁有路由參數,使用this.props.history.push('/a')跳轉到對應路由的頁面babel 使用withRouter能
相關文章
相關標籤/搜索