-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
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)
);
Metadata
Metadata
Assignees
Labels
No labels