我正在调用一个动作创建者并将其发送到reducer并使用react promise来处理promise。但是我收到了一个错误,并且不确定如何修复它或在我的代码中查找。
this.props.loginUser(props)
.then(() => {
console.log("success");
}).catch(error =>{
console.log(error);
});
错误:
<body> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.
Mount React App:
ReactDOM.render(
<Provider store={createStoreWithMiddleware(reducers)}>
<Router history={browserHistory} routes={routes} />
</Provider>
, document.getElementById('app'));
的index.html
<body>
<div id="app"></div>
</body>