var React = require('react'); var FeatureForm = require('./FeatureForm'); var Feature = React.createClass({ getInitialState: function() { return { editMode: false }; }, toggleEditMode: function() { this.setState({editMode: !this.state.editMode}); }, saveFeature: function(feature) { this.props.onChange(feature); this.toggleEditMode(); }, render: function() { return this.state.editMode ? this.renderEditMode() : this.renderViewMode(); }, renderEditMode: function() { return (