Skip to content

Commit

Permalink
feat(hooks): inject renderToString (#411)
Browse files Browse the repository at this point in the history
follow up on algolia/react-instantsearch#3658

to be merged once this is released
  • Loading branch information
Haroenv authored Oct 25, 2022
1 parent 24d9793 commit ae4c58d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion react-instantsearch-hooks/remix/app/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { renderToString } from 'react-dom/server';
import algoliasearch from 'algoliasearch/lite';
import type { InstantSearchServerState } from 'react-instantsearch-hooks-web';
import {
Expand Down Expand Up @@ -38,7 +39,9 @@ export const links: LinksFunction = () => [

export const loader: LoaderFunction = async ({ request }) => {
const serverUrl = request.url;
const serverState = await getServerState(<Search serverUrl={serverUrl} />);
const serverState = await getServerState(<Search serverUrl={serverUrl} />, {
renderToString,
});

return json({
serverState,
Expand Down
4 changes: 2 additions & 2 deletions react-instantsearch-hooks/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ae4c58d

Please sign in to comment.