Skip to content

react-instantsearch-nextjs: <SearchBox /> outside <InstantSearchNext /> #6026

Answered by Haroenv
pepew-le-boss asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure if that's compatible with RSC or your app, but have you considered React Portals? In the past this solution has worked well for putting components in the header.

One thing we don't have is instantiating the InstantSearch once and then passing that to multiple providers. This is possible in theory, but I'm not sure how it could be done practically with a nice API. You could probably imagine creating the InstantSearch instance (inside the InstantSearch component, useInstantSearchAPI private hook return value), then passing that to the private InstantSearch providers etc. If you're interested in exploring that, that would be interesting

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by pepew-le-boss
Comment options

You must be logged in to vote
2 replies
@Haroenv
Comment options

@pepew-le-boss
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants