reactivesearch

ReactiveSearch custom component and clear filters


I created a custom ReactiveComponent based on the official docs: https://docs.appbase.io/docs/reactivesearch/v3/advanced/reactivecomponent/

This works fine, however when I use the component and clear the filter of my custom component, how can I update the ui state of the custom component?

Using the example in the docs: When clearing the color filter, how can I update the ColorPicker UI state to reflect that no color is selected?

Haven't found anything related to this in the docs.


Solution

  • In case anyone else encounters the same issue: The render props of include a value object which is set to null if you clear the filters. This way it is possible to conditionally update the ColorPicker UI state (or whatever custom component you use).