Hillary and Trump sagas

This commit is contained in:
Rodrigo Pedroso 2019-06-21 10:53:16 -04:00
commit aac33139ba
5 changed files with 75 additions and 11 deletions

View file

@ -17,7 +17,7 @@ class ConnectedForm extends Component {
this.state = {
title: '',
candidate: 'Hillary'
candidate: ''
}
this.handleChange = this.handleChange.bind(this)
@ -26,6 +26,11 @@ class ConnectedForm extends Component {
this.clickHilary = this.clickHilary.bind(this)
}
componentDidMount() {
this.props.setCandidate('Hillary Clinton')
this.setState({ candidate: 'Hillary Clinton'})
}
handleChange(event) {
this.setState({ [event.target.id]: event.target.value })
}