Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
fix: Allow object as type for Root (Fixes #1446) (#1461)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger authored and samouss committed Aug 7, 2018
1 parent 182ca8d commit 7c2317b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
6 changes: 5 additions & 1 deletion packages/react-instantsearch-core/src/components/Index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ Index.propTypes = {
indexName: PropTypes.string.isRequired,
children: PropTypes.node,
root: PropTypes.shape({
Root: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
Root: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.object,
]),
props: PropTypes.object,
}).isRequired,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ InstantSearch.propTypes = {
children: PropTypes.node,

root: PropTypes.shape({
Root: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
Root: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.object,
]),
props: PropTypes.object,
}).isRequired,

Expand Down
6 changes: 5 additions & 1 deletion packages/react-instantsearch-core/src/core/createIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const createIndex = defaultRoot => {
CreateIndex.propTypes = {
indexName: PropTypes.string.isRequired,
root: PropTypes.shape({
Root: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
Root: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.object,
]).isRequired,
props: PropTypes.object,
}),
children: PropTypes.node,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ export default function createInstantSearch(defaultAlgoliaClient, root) {
onSearchParameters: PropTypes.func,
resultsState: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
root: PropTypes.shape({
Root: PropTypes.oneOfType([PropTypes.string, PropTypes.func])
.isRequired,
Root: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.object,
]).isRequired,
props: PropTypes.object,
}),
};
Expand Down

0 comments on commit 7c2317b

Please sign in to comment.