Replies: 0 comments 6 replies
-
Thanks for the suggestion. In the long run, we plan on improving this refine API to accept multiple values. We're currently working on a new function Search() {
const { setIndexUiState } = useInstantSearch(); // now public!
return (
<div>
<SearchBox />
<RefinementList attribute="brand" />
<button
onClick={() => {
setIndexUiState((prevUiState) => ({
...prevUiState,
refinementList: {
...prevUiState.refinementList,
brand: ['Apple', 'Samsung'],
},
}));
}}
>
Update state
</button>
</div>
);
}
function App(props) {
return (
<InstantSearch {...props}>
<Search />
</InstantSearch>
);
} You can expect this new API to land in the next few days. Could you share your use case so we better understand why you need to refine multiple values? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
useRefinementList
returns arefine
method but as far as I could find, it only allows for refining a single value. It would be nice if this supported the array syntax ofrefine
fromuseConfigure
.Beta Was this translation helpful? Give feedback.
All reactions