Thanks for the response! Did some more digging and...
# community-help
j
Thanks for the response! Did some more digging and found that
react-instantsearch
should be used for web apps, and
react-instantsearch-core
specifically should be used for react native/mobile per the algolia docs (this was a little hidden as you had to see the upgrade to v7 instructions, but had no need to read that since I'm using it for the first time). This is an important distinction because using
react-instantsearch
in an RN project was giving me lots of errors. The one I was getting using
SearchBox
is:
Copy code
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
with just this:
Copy code
import { InstantSearch, SearchBox } from 'react-instantsearch';

// ...
<InstantSearch ... >
   <SearchBox />
</InstantSearch>
Am now using
useSearchBox
with
react-instantsearch-core
and its working so far, but you do have to implement your own SearchBox component (doesn't seem like there's an out-of-box component for RN). This is all from the React Native section that I actually only found after asking the original question!