From ae4c58d241d551a583c048cb7d7361521aed0310 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Tue, 25 Oct 2022 13:40:51 +0200 Subject: [PATCH] feat(hooks): inject renderToString (#411) follow up on https://github.com/algolia/react-instantsearch/pull/3658 to be merged once this is released --- react-instantsearch-hooks/remix/app/routes/index.tsx | 5 ++++- react-instantsearch-hooks/remix/package.json | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/react-instantsearch-hooks/remix/app/routes/index.tsx b/react-instantsearch-hooks/remix/app/routes/index.tsx index dff17af99e..d2fd6201c8 100644 --- a/react-instantsearch-hooks/remix/app/routes/index.tsx +++ b/react-instantsearch-hooks/remix/app/routes/index.tsx @@ -1,3 +1,4 @@ +import { renderToString } from 'react-dom/server'; import algoliasearch from 'algoliasearch/lite'; import type { InstantSearchServerState } from 'react-instantsearch-hooks-web'; import { @@ -38,7 +39,9 @@ export const links: LinksFunction = () => [ export const loader: LoaderFunction = async ({ request }) => { const serverUrl = request.url; - const serverState = await getServerState(); + const serverState = await getServerState(, { + renderToString, + }); return json({ serverState, diff --git a/react-instantsearch-hooks/remix/package.json b/react-instantsearch-hooks/remix/package.json index b2e2f0e2b1..db3004fa96 100644 --- a/react-instantsearch-hooks/remix/package.json +++ b/react-instantsearch-hooks/remix/package.json @@ -21,8 +21,8 @@ "instantsearch.css": "7.4.5", "react": "18.1.0", "react-dom": "18.1.0", - "react-instantsearch-hooks-server": "6.30.2", - "react-instantsearch-hooks-web": "6.30.2" + "react-instantsearch-hooks-server": "6.38.0", + "react-instantsearch-hooks-web": "6.38.0" }, "devDependencies": { "@remix-run/dev": "1.6.5",