Trying to use react-app-rewire and create-react-app (instructions followed from antd) with dva and dva-hmr
Without dva-hmr it works. Not sure exact which features dva-hmr adds.
https://github.com/andriijas/create-react-app-playground
When running npm start it should work
Router gets function but might be wrapped in object perhaps thats why it breaks?
Check package.json in repo
+1
I found the solution.
In index.js, change app.router(require('./router')) into something like that:
import router from './router'
app.router(router)
@gaohailang it works like that if i disable dva hmr plugin but with plugin enabled, it doesnt work
Thanks for report, I will fix this problem in babel-plugin-dva-hmr.
Thanks. I got it working with require("./router'").default but hmr did not work, page reload when I save footer.
Sent from my iPhone
On 4 Nov 2017, at 14:59, chencheng (云谦) notifications@github.com wrote:
Thanks for report, I will fix this problem in babel-plugin-dva-hmr.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
It's fixed, try [email protected] .
在 production build里,这个问题好像没有解决,在user-dashboard这个例子生成后,方服务器会报这个错误。
在 create-react-app创建的项目中使用,依然会报错
Most helpful comment
I found the solution.
In index.js, change
app.router(require('./router'))into something like that: