react-templates/playground/samples/rt-props.code

18 lines
487 B
Plaintext

var <%= name %> = React.createClass({
mixins: [React.addons.LinkedStateMixin],
getInitialState: function() {
return { key: 'color', val: 'blue' };
},
getProps: function() {
var ret = { style: {
color: 'black',
backgroundColor: 'white',
borderColor: 'black'
}};
ret.style[this.state.key] = this.state.val;
return ret;
},
render: function () {
return <%= name %>RT.apply(this);
}
});