异步组件与withRouter路由方法

1.将组件进行异步加载用到react-loadable第三方库
https://github.com/jamiebuilds/react-loadable
在这里插入图片描述
2.在组件中从react-router-dom引入{withRouter} 方法,使得组件可以正确获取路由间的传参
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_39786582/article/details/83747127