-
I'm using hooks like useCurrentRefinements to render custom filtering components. The docs seem to imply that the hook call and the markup can be colocated. I've noticed that when selecting a facet value and then hiding the facet component, the filters get dropped. It's common for facet widgets to be hidden when they are rendered in:
An attempted solution would be to create a custom hook hoisted to the root of the component tree. That custom hook can make calls to the Algolia hooks and pass the data to children components which are tasked with rendering the markup. However, I'm unclear:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
A widget can not be removed from the tree without also removing its refinement. A workaround is thus to hide with css or skipping the markup from rendering only (still rendering the hook).
The value returned from InstantSearch hooks is always updated on the last search results. If that's not the case, there's a bug we'd love to see a reproduction for
You can do that, but you can also use DynamicWidgets and define those facets with query rules based on the category for example, although that's delayed with a search request compared to manually maintaining a loop of widgets to render |
Beta Was this translation helpful? Give feedback.
A widget can not be removed from the tree without also removing its refinement. A workaround is thus to hide with css or skipping the markup from rendering only (still rendering the hook).
The value returned from InstantSearch hooks is always updated on the last search results. If that's not the case, there's a bug we'd love to see a reproduction for
You can do that, but you can also use DynamicWidgets and define those facets with query rules based on the category for ex…