-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RefinementList: ease customization with labelComponent #1636
Comments
Yes the API goal was that we did not wanted to provide such feature and rather guide through using connectRefinementList instead. If you need to customize the rendering => use connectors was our moto since the begining. What was the struggle in using the connectRefinementList part? Today we do not feel that using connectors is complex so if it is then we will need more information on why it's hard to take a decision. It's a tricky decision to make because then you have an API where you say "if you want you can configure the rendering a bit, but if you want to go further, use a connector" versus "if you want to configure the rendering, use a connector". Adding more option gives the user the impression that he can be in control while he will have only some control versus using a connector. |
It's not really struggling; it's just that if you don't know how the
I think it really looks like the
Yes, it's a balance we need to find. |
We do want people to have to use connectors as soon as they hit a DOM rendering feature wall. We do not want them to think that custom DOM rendering features are spread amongst many features and API entries. Mostly because then you can be lost in feature land, choosing the right path then being hard to do. If we identify clear common use cases where the need for a hit/label component is really beneficial then we will need to revisit this issue. Also we recently introduced "transformItems" props on widget which can make it easier to inject some data/rephrase some labels (without touching the DOM). https://community.algolia.com/instantsearch.js/react/guide/Sorting_and_filtering.html |
Works for me 👍 |
Do you want to request a feature or report a bug?
Feature.
What is the current behavior?
Often times, you just want to change the way the items are displayed in a RefinementList (with more than just CSS). For that, the only option so far is to use the
connectRefinementList
connector and rebuild the refinement list yourself.It turns out that handling the logic around
isRefined
,createURL
andrefine
is not that trivial and I was wondering whether we couldn't introduce alabelComponent
which would be responsible of rendering thelabel
based on the item.Something like:
The text was updated successfully, but these errors were encountered: