React native alt dispatcher this.dispatch不是Babel 6的函数

G. *_*ide 1 javascript babeljs react-native

我今天早上将我的项目从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);
Run Code Online (Sandbox Code Playgroud)

这是我使用插件alt的Alt.js文件:

'use strict';

import Alt from 'alt';
export default new Alt();
Run Code Online (Sandbox Code Playgroud)

现在,我在调用时运行代码"this.dispatch不是函数" MeActions.showedCurrentPosition(true);

运行应用程序时抛出错误

rme*_*ns9 5

您可能最终也升级了Alt.最近的一个版本摆脱了派遣,转而支持简单的回报.查看有关操作的文档http://alt.js.org/docs/createActions/