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 46b4924
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seanhouli/react-mapbox-search",
"version": "1.0.3",
"version": "1.0.4",
"description": "A location picker component that uses Mapbox's places API to provide location suggestions",
"main": "dist/index",
"scripts": {
Expand Down
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 46b4924

Please sign in to comment.