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

chore(index): don't require indexId on IndexWrapper #2834

Merged
merged 2 commits into from
Sep 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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