我今天早上将我的项目从 RN 0.15.0 升级到 0.16.0,并且由于传递到 Babel 6 而出现了许多错误。 有一个我不明白(我猜它在我的 .babelrc 文件中丢失了一些东西)
此代码在升级前运行良好:
'use strict';
import alt from '../alt';
import MeStore from '../stores/Me';
export class MeActions {
showedCurrentPosition(showed) {
this.dispatch(showed);
}
}
export default alt.createActions(MeActions);
这是我使用插件 alt 的 Alt.js 文件:
'use strict';
import Alt from 'alt';
export default new Alt();
现在,我在调用 MeActions.showedCurrentPosition(true);
最佳答案
您可能最终也升级了 Alt。最近的一个版本取消了 dispatch,取而代之的是简单的返回。查看有关操作的文档 http://alt.js.org/docs/createActions/
关于javascript - React native alt dispatcher this.dispatch 不是函数 Babel 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34414619/