Skip to content

Instantly share code, notes, and snippets.

@DimaDaxDadeco
Created September 24, 2018 10:53
Show Gist options
  • Save DimaDaxDadeco/c48eb582cb91d8df07b08127ccfd0f13 to your computer and use it in GitHub Desktop.
Save DimaDaxDadeco/c48eb582cb91d8df07b08127ccfd0f13 to your computer and use it in GitHub Desktop.
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