React-Router 4.0 withRouter做用和一個簡單應用

React-Router 4.0 withRouter做用 1.目的就是讓被修飾的組件能夠從屬性中獲取history,location,match 路由組件能夠直接獲取這些屬性,而非路由組件就必須經過withRouter修飾後才能獲取這些屬性了,好比html <Route path='/' component={App}/> App組件就能夠直接獲取路由中這些屬性了,可是,若是App組件中若是有一
相關文章
相關標籤/搜索