PussInBoots
PussInBoots

Reputation: 12353

React InstantSearchNext, Next.js App Router

I've been following how to configure instantsearch React with Next.js App Router here: https://www.algolia.com/doc/guides/building-search-ui/going-further/server-side-rendering/react/#app-router-experimental and I've done this successfully in my app.

What im wondering is:

  1. Can i move <InstantSearchNext> so that it wraps my entire app?

  2. If I move it, will SSR break since now I will have to put use client around my entire app?

This topic is not covered in the docs so i would appreciate if someone could clarify it for me.

Thanks.

Upvotes: 2

Views: 484

Answers (1)

ulas.kesik
ulas.kesik

Reputation: 448

I don’t think it’s a good idea to move <InstantSearchNext> to the layout level and wrap the entire application. Doing so means the whole DOM would wait for Algolia to load, even for components that aren’t related to search.

Additionally, making the entire app client-side isn’t ideal due to concerns like SEO and initial loading speed.

Upvotes: 0

Related Questions