-
Notifications
You must be signed in to change notification settings - Fork 2
Search Bar
brandonk1234 edited this page Dec 5, 2016
·
2 revisions
The search bar component allows the user to query results by typing inside the input field. The component consists of one secondary button and a input element.
The props needed for this component are listed and explained below:
-
onClick
- This prop must be afunction
-
onChange
- This prop must be afunction
. Remember that the onChange always passes up theevent.target.value
.
<SearchBar
onClick={this.onClick}
onChange={this.onChange}
/>
// ...React Component
onClick: function() {
console.log('this search button has been clicked');
},
onChange: function(value) {
this.setState({
searchText: value
})
},