You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the HoC or AltContainer wraps your component and makes it impossible to call any static method on your component you have to use a util from alt called statics
import connectToStores from 'alt-utils/lib/connectToStores';
import statics from 'alt-utils/lib/statics';
class SomeComponent extends React.Component{
static getStores() {
return [SomeStore]
}
static getPropsFromStores() {
return SomeStore.getState()
}
render(){
return ....
}
}
//declare your functions as constants
const loadProps = (params, cb) => {
cb(null, {
tacos: [ 'Pollo', 'Carnitas' ]
})
}
//pass them to statics first param (used ES6 desctructor)
export default statics(
{ loadAsyncData },
connectToStores(WorkflowPage)
);
The text was updated successfully, but these errors were encountered:
Since the HoC or AltContainer wraps your component and makes it impossible to call any static method on your component you have to use a util from alt called statics
The text was updated successfully, but these errors were encountered: