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

Commit

Permalink
chore(index): don't require indexId on IndexWrapper (#2834)
Browse files Browse the repository at this point in the history
* Don't require `indexId` proptype on Index widget wrapper

* Use unique type for IndexWrapper props
  • Loading branch information
coreyward authored and Haroenv committed Sep 17, 2019
1 parent bd9d04c commit 4052367
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/react-instantsearch-core/src/widgets/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ class Index extends Component<InnerProps, State> {
}
}

const IndexWrapper: React.FC<Props> = props => {
type IndexWrapperProps = {
indexName: string;
indexId?: string;
};

const IndexWrapper: React.FC<IndexWrapperProps> = props => {
const inferredIndexId = props.indexName;
return (
<InstantSearchConsumer>
Expand All @@ -140,7 +145,7 @@ const IndexWrapper: React.FC<Props> = props => {

IndexWrapper.propTypes = {
indexName: PropTypes.string.isRequired,
indexId: PropTypes.string.isRequired,
indexId: PropTypes.string,
};

export const IndexComponentWithoutContext = Index;
Expand Down

0 comments on commit 4052367

Please sign in to comment.