Current Refinement Data

React: Hello, how can I acquire which current Refinement is active? I don’t wanna use a component to show current Refinement, I just need to fetch the data of which current Refinements are active? Thank you!

Hi @branislav.brnjos, you just need to use the connector connectCurrentRefinements. It expose the data, normally to make it possible to build any UI you want on top of it, but you can also decide to return null if you just need the data.

There is full working example here:

Hi @Youcef thank you so much for this! Just one more question, i am already using connectInfiniteHits, am i able to connect both connections?

forExample: export default connectInfiniteHits(InfiniteHitsWithScrollToTop);

I wouldn’t recommend composing connectors. You can tell they were designed for “unlimited” composition just by the fact they all expose the same items and refine.

However in most cases you can reach what you want just by splitting your components furthermore.
I mean if your component needs connectInfiniteHits data AND connectCurrentRefinement data may be it’s complex enough that it’s a good idea to split it.