Skip to content

Instantly share code, notes, and snippets.

@kwunyeung
Last active May 7, 2018 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwunyeung/02c4191766404d5b0617867d92ffc6fa to your computer and use it in GitHub Desktop.
Save kwunyeung/02c4191766404d5b0617867d92ffc6fa to your computer and use it in GitHub Desktop.
Search bar
toggleSearchInput = e => {
e.preventDefault();
this.setState({isShown = !this.state.isShown});
}
render(){
return
<div>
(this.state.isShown?
<SearchInput />:''}
<img src="/icons/icon/ic-search.svg" alt="search" id="navi-img" onClick={this.toggleSearchInput}/>
</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment