Created
September 24, 2018 10:53
-
-
Save DimaDaxDadeco/c48eb582cb91d8df07b08127ccfd0f13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export Form extends Component { | |
state = { | |
placeName: '', | |
}; | |
onChange = (e) => { | |
this.setState({ | |
placeName: e.target.value | |
}); | |
}; | |
onClick = () => { | |
this.props.onGoButton(this.state.placeName); | |
}; | |
render() { | |
<form className='page-form'> | |
<input type='text' className='search-input' onChange={this.onChange)/> | |
<button type='button' className='btn btn--search' onClick={this.onClick}>Go</button> | |
<button className='btn btn--location'>My location</button> | |
<span className='status-bar'>{this.props.data}</span> | |
<fieldset className='results'> {this.props.locationList} </fieldset> | |
</form>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment