I recently integrated the React InstantSearch library into my app and I'm working on customizing the refinement list to display only relevant filters for the active user. I attempted the following code:
<RefinementList attributeName="organization" transformItems={items => items.filter(e => refineList.indexOf(e) >= 0)} />
Here, refineList is a basic array of strings (e.g., ["A", "B", "C"])
Despite applying the "transformItems" function, the RefinementList continues to show all filter options. Could it be that I misunderstood how "transformItems" functions?
The documentation on this subject is lacking, so I believe it would be beneficial for other users of the library as well.