关于使用react-loadable 无法传递props的问题

#1

使用了react-loadable + webpack4 + react-router4 进行按需懒加载以及code split,

如:

和router

这样之后,props没有传递到pagehome组件,所以按照官方直接使用react-loadable 不行?还得在包裹一层?

#2

你直接用react-routerv4的Route的render这个api,不用component就好了

1 Like
#3

withRouter 就可以了