From 379da8092200e8ee123c688e6d9bb8644d381857 Mon Sep 17 00:00:00 2001 From: Corey Ward Date: Mon, 16 Sep 2019 20:19:45 -0500 Subject: [PATCH 1/2] Don't require `indexId` proptype on Index widget wrapper --- packages/react-instantsearch-core/src/widgets/Index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-instantsearch-core/src/widgets/Index.tsx b/packages/react-instantsearch-core/src/widgets/Index.tsx index 1cbd34a2c8..97c961cdbe 100644 --- a/packages/react-instantsearch-core/src/widgets/Index.tsx +++ b/packages/react-instantsearch-core/src/widgets/Index.tsx @@ -140,7 +140,7 @@ const IndexWrapper: React.FC = props => { IndexWrapper.propTypes = { indexName: PropTypes.string.isRequired, - indexId: PropTypes.string.isRequired, + indexId: PropTypes.string, }; export const IndexComponentWithoutContext = Index; From 901a67ca29462a4976711225748a71186817c30e Mon Sep 17 00:00:00 2001 From: Corey Ward Date: Tue, 17 Sep 2019 10:34:27 -0500 Subject: [PATCH 2/2] Use unique type for IndexWrapper props --- packages/react-instantsearch-core/src/widgets/Index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-instantsearch-core/src/widgets/Index.tsx b/packages/react-instantsearch-core/src/widgets/Index.tsx index 97c961cdbe..679147e80b 100644 --- a/packages/react-instantsearch-core/src/widgets/Index.tsx +++ b/packages/react-instantsearch-core/src/widgets/Index.tsx @@ -123,7 +123,12 @@ class Index extends Component { } } -const IndexWrapper: React.FC = props => { +type IndexWrapperProps = { + indexName: string; + indexId?: string; +}; + +const IndexWrapper: React.FC = props => { const inferredIndexId = props.indexName; return (