SSR
To get started you'll first need to upgrade to the following package versions:
@useractify/search
version 5.50.1 (minimum)
Afterwards you'll use the generateProviderProps
method on the server, you provide all of the props you normally would to the ReactifySearchProvider
component, these props will be parsed and then returned with an additional prop called preload
, this is what enables SSR to work correctly.
In addition to the usual props there is a new one called query
which should contain the url query params as an object which will look something like this e.g.
The tech stack you're using will determine exactly how this should be implemented but generally speaking you'll want to serialise the return value of generateProviderProps
and pass it to the client, see some examples below.
NextJs
Sandbox https://codesandbox.io/p/devbox/reactify-search-ssr-nextjs-sandbox-p28m4g
Last updated