Is having multiple InstantSearch component instances a bad thing?

Hi guys,

Im trying to set up a Search Result screen in React Native with multiple tabs to show multiple index results. The problem is that it seems difficult to wrap all the tabs under one InstantSearch component so I could provide each tab with a Hits component.

I was asking myself how bad it would be to instantiate an InstantSearch component for every tab. Will this result in more requests to Algolia? Will this turn out to be more expensive?

Thanks for the help!

It shouldn’t create more requests and the only drawback I can see is that you won’t keep any search context and you won’t be able to share UI elements (like the searchbox)

Well, my searchbar is placed in the header so I cannot wrap it in an InstantSearch component together with the Hits etc. So I thought having different InstantSearch components would be a solution. Or is it perhaps better to not use InstantSearch in this case and use the higher level api?

I’m probably biased here, since I’m working on the instantsearch libraries but the answer is almost never to not use instantsearch. Can you try to make it work and we can have a look?

Then Ill just stick with my initial idea of using multiple InstantSearch components and make a gist afterwards

1 Like