Skip to content

Commit

Permalink
fix(createInstantsearch): fix missing props (#1867)
Browse files Browse the repository at this point in the history
Based on @zackify findings: add back the missing props types and forward
them to InstantSearch. This commit adds them explicitly.
  • Loading branch information
bobylito authored Jan 18, 2017
1 parent 730ed82 commit 8d319b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ Object {
"addAlgoliaAgent": [Function],
},
"children": undefined,
"createURL": undefined,
"indexName": "name",
"onSearchStateChange": undefined,
"root": Object {
"Root": "div",
},
"searchParameters": undefined,
"searchState": undefined,
}
`;
8 changes: 8 additions & 0 deletions packages/react-instantsearch/src/core/createInstantSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export default function createInstantSearch(defaultAlgoliaClient, root) {
React.PropTypes.node,
]),
indexName: PropTypes.string.isRequired,
searchParameters: PropTypes.object,
createURL: PropTypes.func,
searchState: PropTypes.object,
onSearchStateChange: PropTypes.func,
};

constructor(props) {
Expand All @@ -41,7 +45,11 @@ export default function createInstantSearch(defaultAlgoliaClient, root) {
render() {
return (
<InstantSearch
createURL={this.props.createURL}
indexName={this.props.indexName}
searchParameters={this.props.searchParameters}
searchState={this.props.searchState}
onSearchStateChange={this.props.onSearchStateChange}
root={root}
algoliaClient={this.client}
children={this.props.children}
Expand Down

0 comments on commit 8d319b5

Please sign in to comment.