Closed zaxlct closed 7 years ago
reflux v0.4.1 react v15.1.0
var Actions1 = Reflux.createActions(["increment"]); var Actions2 = Reflux.createActions(["decrement"]); class DeviceInfoSR extends Reflux.Store { constructor() { super(); this.listenables = [Actions1, Actions2]; this.state = {count:0}; } onIncrement() { var cnt = this.state.count; this.setState({count:cnt+1}); } onDecrement() { var cnt = this.state.count; this.setState({count:cnt-1}); } } class DeviceInfo extends Reflux.Component { constructor(props) { super(props); this.state = {}; this.store = DeviceInfoSR; // <- just assign the class itself } render() { return <p>Count: {this.state.count}</p>; } }
Uncaught TypeError: Super expression must either be null or a function, not undefined
WHY ???
The first problem I see is that you're using extends Reflux.Store which does not exist in reflux v0.4.1, it exists from reflux v5.0.0 so update to the latest and try again :)
extends Reflux.Store
reflux v0.4.1
v5.0.0
Tnanks
reflux v0.4.1 react v15.1.0
Uncaught TypeError: Super expression must either be null or a function, not undefined
WHY ???