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

v6.0.0-beta.0 requires indexId on <Index> #2832

Closed
coreyward opened this issue Sep 17, 2019 · 0 comments
Closed

v6.0.0-beta.0 requires indexId on <Index> #2832

coreyward opened this issue Sep 17, 2019 · 0 comments

Comments

@coreyward
Copy link
Contributor

There appears to be a transition going on from indexName to indexId, but this is incomplete and not documented. I think the IndexWrapper component was added to make this transition easier, but the PropTypes set for it require both indexName and indexId despite synthesizing the latter from the former:

const IndexWrapper: React.FC<Props> = props => {
const inferredIndexId = props.indexName;
return (
<InstantSearchConsumer>
{contextValue => (
<Index
contextValue={contextValue}
indexId={inferredIndexId}
{...props}
/>
)}
</InstantSearchConsumer>
);
};
IndexWrapper.propTypes = {
indexName: PropTypes.string.isRequired,
indexId: PropTypes.string.isRequired,
};

The result of this is PropType errors being displayed on the client inside of downstream applications when running React in development mode.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants