Skip to content

Commit

Permalink
add default query prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Houlihan committed Jul 8, 2019
1 parent eee65d4 commit 1e7bf3c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Components/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SearchBox extends React.Component {
constructor(props) {
super(props);
this.state = {
query: "",
query: props.query,
queryResults: [],
cursorIdx: 0,
getMouseInSuggestions: false,
Expand Down Expand Up @@ -188,14 +188,20 @@ SearchBox.propTypes = {
/**
* hint text for input
*/
searchHint: PropTypes.string
searchHint: PropTypes.string,

/**
* default query text
*/
query: PropTypes.string
};

SearchBox.defaultProps = {
country: undefined,
selectColor: "#58a",
callback: undefined,
searchHint: "Search"
searchHint: "Search",
query: ""
};

export default SearchBox;

0 comments on commit 1e7bf3c

Please sign in to comment.