var React = require('react'); var ItemForm = React.createClass({ getInitialState: function() { return { label: '', icon: '', exec: '' }; }, componentWillReceiveProps: function(props) { if(props.item) { this.setState({ label: props.item.label, icon: props.item.icon, exec: props.item.exec }); } }, render: function() { var state = this.state; return (