Unless contextTypes is set manually on the target component, the flux prop is missing and no context is sent to listenTo() or getProps.
As a workaround, I currently have this middleware:
import React from 'react';
import { connect } from 'alt-react';
module.exports = function (Ele, opt) {
Ele.contextTypes = {
flux: React.PropTypes.object
};
return connect(Ele, opt);
};
It would be good if connect automatically added contextTypes to the target element if it doesn't already exist, or extends it with flux if it does.
Unless
contextTypesis set manually on the target component, thefluxprop is missing and no context is sent tolistenTo()orgetProps.As a workaround, I currently have this middleware:
It would be good if connect automatically added
contextTypesto the target element if it doesn't already exist, or extends it withfluxif it does.