Skip to content

Instantly share code, notes, and snippets.

@kwunyeung kwunyeung/SearchBar.jsx
Last active May 7, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.