Passed other props into "Product" <Hits hitComponent={Product} />

Hello !
Anyone know how can i pass other values my Product component please ?
Like :

const ProductUI = <Product value='toto' />
<Hits hitComponent={ProductUI} />

Thanks u

Hi @wyeo,

If you need other values that are not contained inside the hits, then you can simple use the connectHits connector.

Usage:

<Product value='toto' />

const Product = connectHits(({hits, value}) => {
     const hits = hits.map(hit => ...);
     return <div>{hits}</div>
});

Does this help?

1 Like