【发布时间】:2017-10-25 05:11:55
【问题描述】:
我似乎一直遇到同样的问题,我得到同样的错误:
A new promise was created but was not returned
我在 .then 块的末尾返回数据,但是似乎无法弄清楚我做错了什么。我什至只是遇到了这个问题并复制了代码,但似乎遇到了同样的错误。
componentDidMount() {
if (this.props.user.currentUser == null) {
this.props
.currentUser()
.then(data => {
console.log(data);
return data;
})
.catch(err => {
return err;
});
}
}
【问题讨论】:
-
为了自己的充实,不再需要蓝鸟。 ES6 的标准中包含了 Promise。
标签: javascript reactjs promise redux bluebird