Last active
August 29, 2015 14:27
-
-
Save Carlsson87/66adc9c8f7d843af2502 to your computer and use it in GitHub Desktop.
Higher Order Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Låtsas att alla require's finns här uppe. | |
function hasResources(Component) { | |
return React.createClass({ | |
mixins: [ | |
Reflux.connect(ResourceStore, 'resources') | |
], | |
render() { | |
return <Component {...this.props} resources={ this.state.resources }/> | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hasResources = require('./hasResources'); | |
var EditableImageBlock = React.createClass({ | |
// bla bla bla ... | |
}); | |
module.exports = hasResources(EditableImageBlock); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment