I upgraded the Redux and react-redux versions in the project:
1.bump Redux from 4.2.1 to 5.0.1
2.bump react-redux from 5.1.2 to 9.1.2
I have a basic Connector, custom connect, code is as follows:
export default class Connector {
constructor(TheComponent) {
bindThis(this);
const that = this;
this.name = TheComponent.name || TheComponent.displayName;
const WrappedComponent = connect(
this.mapStateToProps,
this.mapDispatchToProps,
this.mergeProps,
{
areStatePropsEqual: (nextStateProps, stateProps) => {
// this.triggerActions(this.dispatch, this.store.getState(), nextStateProps);
this.__propsNotChanged = this.areStatePropsEqual(nextStateProps, stateProps);
return this.__propsNotChanged;
},
}
)(TheComponent);
class Wrapped extends WrappedComponent {
constructor(props, context) {
super(props, context);
}
componentWillMount() {
// dispatch actions as fast as possible
that.triggerActions(that.dispatch, that.store.getState(), this.selector.props);
}
componentWillUnmount() {
super.componentWillUnmount();
that.__subscribtion();
}
componentDidMount() {
super.componentDidMount();
}
}
return Wrapped;
}
}
This error will occur as long as you upgrade to any version above react-redux v7,I now get this error:
Super expression must either be null or a function
at _inherits (connector.js:4:75)
at eval (connector.js:146:5)
I hope to fix this error