Skip to content

React Instant Search SSR (Next) is rendering client side #5367

Answered by dhayab
avremel asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @avremel , you need to pass down the data from serverState to <InstantSearchSSRProvider>:

<InstantSearchSSRProvider {...serverState}>
  {/* ... */}
</InstantSearchSSRProvider>

Edit: I missed the part when you specified you didn't want to retrieve initialResults in non-list pages. For the moment this data is required, but you could replace it with an empty object in a similar manner as this:

// Determines whether or not to get the initial results from Algolia
const shouldGetServerState = false;

export const getServerSideProps: GetServerSideProps<HomePageProps> =
  async function getServerSideProps({ req }) {
    const protocol = req.headers.referer?.split('://')[0] || 'https';
    const 

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@avremel
Comment options

@Haroenv
Comment options

@avremel
Comment options

@avremel
Comment options

@avremel
Comment options

Answer selected by avremel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Library: React InstantSearch ≥ 7 Issues in any of the react-instantsearch@7 packages (formerly named react-instantsearch-hooks)
3 participants