-
Notifications
You must be signed in to change notification settings - Fork 386
react-instantsearch-hooks-server doesn't work with react 18 #3453
Comments
Very annoying, in React 17 only For the time being I recommend the following:
diff --git a/node_modules/react-instantsearch-hooks-server/dist/es/getServerState.js b/node_modules/react-instantsearch-hooks-server/dist/es/getServerState.js
index 23b1503..328227a 100644
--- a/node_modules/react-instantsearch-hooks-server/dist/es/getServerState.js
+++ b/node_modules/react-instantsearch-hooks-server/dist/es/getServerState.js
@@ -6,7 +6,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
import { isIndexWidget } from "instantsearch.js/es/widgets/index/index.js";
import React from 'react';
-import ReactDOM from "react-dom/server.js";
+import ReactDOM from "react-dom/server";
import { InstantSearchServerContext, InstantSearchSSRProvider } from 'react-instantsearch-hooks';
/** A proof of this working is https://codesandbox.io/s/omyt57?file=/patches/react-instantsearch-hooks-server%2B6.24.0.patch For checking whether a solution we have works, this is a reproduction of the issue (updated dependencies of main example): https://codesandbox.io/s/old-sun-2v2ru9 |
Hey Haroenv, |
@foshfue do you have a github repo or similar with your setup that still fails after that patch? |
* feat(hooks-server): support import from React 18 fixes #3453 * avoid crowding the main function * move unimportant part to end to ease diff * make umd build again * rename * Update packages/react-instantsearch-hooks-server/rollup.config.js * one file per test * Apply suggestions from code review Co-authored-by: Sarah Dayan <5370675+sarahdayan@users.noreply.github.com> Co-authored-by: Sarah Dayan <5370675+sarahdayan@users.noreply.github.com>
Same issue, any ideas when this fix will be available? I am using the workaround for now |
it will be released today :) |
…ntsearch#3464) * feat(hooks-server): support import from React 18 fixes algolia/react-instantsearch#3453 * avoid crowding the main function * move unimportant part to end to ease diff * make umd build again * rename * Update packages/react-instantsearch-hooks-server/rollup.config.js * one file per test * Apply suggestions from code review Co-authored-by: Sarah Dayan <5370675+sarahdayan@users.noreply.github.com> Co-authored-by: Sarah Dayan <5370675+sarahdayan@users.noreply.github.com>
🐛Upgrade react-instantsearch-hooks-server to work with react 18
🖥 Screenshots
Environment
package.json
The text was updated successfully, but these errors were encountered: