InputWrapper.jsx 491 B

123456789101112131415
  1. //takes reference & name for arguments
  2. var InputWrapper = React.createClass({
  3. getInitialState: function() {
  4. return {
  5. value: ""
  6. }
  7. },
  8. handleChange: function(event) {
  9. this.setState({value: event.target.value});
  10. },
  11. render: function() {
  12. return <div> {this.props.input_template.label} <input className={"form-control"} type="text" value={this.state.value} placeholder={this.props.arg} onChange={this.handleChange}/> </div>
  13. }
  14. });