React route

React route
route中的component属性是接收函数、字符串、class的,component渲染出来的组件能直接在组件中拿到this.props中的路由等信息。
render是接收组件的,要加标签符号,render渲染出来的组件this.props是个空对象,拿不到路由等信息,需要使用import { withRouter } from 'react-router-dom’中的withRouter包一下,就能在this.props中拿到路由等信息了。
react-redux中的connect包之后的组件this.props中也是没有路由信息的,需要用withRouter包