connectHitInsights not exported by 'react-instantsearch-dom'

Hi, i was trying to set-up insights for our algolia app following this guide: https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-through-and-conversions/how-to/send-click-and-conversion-events-with-instantsearch/react/#prepare-react-instantsearch-to-connect-with-insights-client-for-javascript

However, it seems like there is no connectHitInsights exported from ‘react-instantsearch-dom’. Is this an error in docs?

ok ,this just looks like a type issue in index.d.ts of react-instantsearch-dom

Hi @karol.kot ! If you believe you’ve found an issue in our library, please raise an issue on https://github.com/algolia/react-instantsearch/ (or even more awesome would be submitting a PR!). :slight_smile:

Thanks @karol.kot! Can you tell us which version of React Instantsearch you’re using?

@instantsearch it looks like it exported but not sure why it’s not ending up in the .d.ts files:

Hey, its: “react-instantsearch-dom”: “6.4.0”

Hi Karol, this is actually expected, since the typings are community-maintained and on definitelyTyped: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-instantsearch-dom/index.d.ts To have access to the connectHitInsights from TS you will need to either ts-ignore that line, or make a pull request to definitelytyped to have it out of the box.

1 Like