I'm using Alt.js's connectToStores to access store state inside a component, but when I try to call this component's method from aother component (using a ref), the method seems to be lost because of a wrapper component (gives undefined method).
comp_a.js
class CompA extends React.Component {
...
static getStores() { ... }
static getPropsFromStores() { ... }
...
method() {
}
...
}
export default connectToStores(CompA);
comp_b.js
class CompB extends React.Component {
...
test() {
// Causes error because "method()" is lost during connectToStores export
// It seems that connectToStores doesn't inherit the base component, instead it wraps the component with another component.
this.refs.other.method();
}
...
render() {
return (
<CompA ref="other" />
);
}
...
}
Is there any way to still call method() ?
Is there any way to access the wrapped component?