You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 30, 2022. It is now read-only.
feat(useInstantSearch): expose status & error (#3645)
<!--
Thanks for submitting a pull request!
Please provide enough information so that others can review your pull
request.
-->
**Summary**
<!--
Explain the **motivation** for making this change.
What existing problem does the pull request solve?
Are there any linked issues?
-->
Introduces `status` and `error` in the response of `useInstantSearch`,
as well as a new option on `useInstantSearch` to indicate errors in the
search lifecycle should be caught.
built on top of algolia/instantsearch#5127
**Result**
<!--
Demonstrate the code is solid.
Example: The exact commands you ran and their output,
screenshots / videos if the pull request changes UI.
-->
```jsx
function Status() {
const { status, error } = useInstantSearch({ catchError: true });
return (
<>
<span>Search status: {status}</span>
{error && <span>a search error occurred: {error.message}</span>}
</>
);
}
```
FX-1769
0 commit comments