Adding additional data to Hit component


I’m currently using algolia react for a dating matching system. I’d like to pass some extra information into the Hits component but it seems to be stripping any other props, is this possible?

eg ‘’

Thanks for any help.


Hi @joe,

I assume that you want to do something of this props. In that case the best way is to use this connectHits connector.

See here for the connector guide:


const CustomHits = connectHits(({hits, data}) => {
        return ... // hits rendering

<CustomHits data="test" />

Ah OK that’s great thanks. Would it be possible to pass in a class to the connect component?

Thanks again for your help.


Yes you can pass a React.Component class and use it inside the connector :slight_smile:


Thanks again! I know this might be a stupid question but the Hits component gives me the ‘Hit’. When using the connector do I have to manually loop through the Hits object or should I have access to the individual hit somewhere?



The connectHits give you an items prop that contain all the hits. Then it’s up to you to iterate on it and build your hit rendering :slight_smile:

You can see here a usage example:

1 Like

Thanks so much for your help