Guest User

Untitled

a guest
Jul 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. this.state.attributes.startDate = ''
  2. this.state.attributes.endDate = ''
  3.  
  4. <Select
  5. className='form-control'
  6. name='endDate'
  7. value={attributes.endDate}
  8. required={true}
  9. onChange={e => {
  10. this.updateAttribute(e, 'startDate')
  11. }}
  12. options={this.options}
  13. />
  14.  
  15. updateAttribute = (e: ReactEvent, attribute: string) => {
  16. e.preventDefault && e.preventDefault()
  17.  
  18. const attributes = {
  19. ...this.state.attributes,
  20. [attribute]: e.target ? e.target.value : e
  21. }
  22. this.setState({ attributes: attributes }, () => this.submitForm())
  23. }
Add Comment
Please, Sign In to add comment