我尝试在index.js中导入此类
import Dispatcher from "flux";
import React from "react";
export class CountdownDispatcher extends Dispatcher {
handleAction(action) {
console.log("dispatching action:", action);
this.dispatch({
source: "VIEW_ACTION",
action
});
}
}
但reactjs编译器首先使用错误消息
加下划线超级表达式必须为null或函数,而不是对象
这是React和redux第186页
的例子尝试像这样导入index.js:
从“./Flux/CountDownDispatcher”导入{CountDownDispatcher};
答案 0 :(得分:0)
从“flux”导入{Dispatcher};