考虑把 react-async-component 给换了,用 https://github.com/faceyspacey/react-universal-component 或者自己实现吧。
试着升级 example 的 react 到 16,发现这个问题应该和升级 react@16 无关。https://github.com/dvajs/dva/commit/953966332558cdacfc106ee7360a74727b8e5f3e
@sorrycc dva-example 路由没有异步加载,所以不会出现该错误。而 dva-example-user-dashboard 路由使用了异步加载,升级到 react 16,则会出现该错误。
使用到dynamic就会出现这个问题
使用了()=>还是会报错,不知道为什么
v2.0.3 does not include this fix. I'm waiting for this to be release on NPM. Thanks.
+1
react-async-component 已经修复了此问题
https://github.com/ctrlplusb/react-async-component/commit/ccf76722ad3d750eeb08acd475eac08c444ec0d9
Most helpful comment
考虑把 react-async-component 给换了,用 https://github.com/faceyspacey/react-universal-component 或者自己实现吧。