Allow components to initialise props

This commit is contained in:
Toby Zerner 2015-05-02 08:45:11 +09:30
parent 3796193291
commit 7d12f7853b

View File

@ -23,6 +23,9 @@ export default class Component {
*/
static component(props) {
props = props || {};
if (this.props) {
props = this.props(props);
}
var view = function(component) {
component.props = props;
return component.view();