Skip to content

Commit ae4c58d

Browse files
authored
feat(hooks): inject renderToString (#411)
follow up on algolia/react-instantsearch#3658 to be merged once this is released
1 parent 24d9793 commit ae4c58d

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

react-instantsearch-hooks/remix/app/routes/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { renderToString } from 'react-dom/server';
12
import algoliasearch from 'algoliasearch/lite';
23
import type { InstantSearchServerState } from 'react-instantsearch-hooks-web';
34
import {
@@ -38,7 +39,9 @@ export const links: LinksFunction = () => [
3839

3940
export const loader: LoaderFunction = async ({ request }) => {
4041
const serverUrl = request.url;
41-
const serverState = await getServerState(<Search serverUrl={serverUrl} />);
42+
const serverState = await getServerState(<Search serverUrl={serverUrl} />, {
43+
renderToString,
44+
});
4245

4346
return json({
4447
serverState,

react-instantsearch-hooks/remix/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"instantsearch.css": "7.4.5",
2222
"react": "18.1.0",
2323
"react-dom": "18.1.0",
24-
"react-instantsearch-hooks-server": "6.30.2",
25-
"react-instantsearch-hooks-web": "6.30.2"
24+
"react-instantsearch-hooks-server": "6.38.0",
25+
"react-instantsearch-hooks-web": "6.38.0"
2626
},
2727
"devDependencies": {
2828
"@remix-run/dev": "1.6.5",

0 commit comments

Comments
 (0)