Skip to content

Commit 7f0bdbb

Browse files
committed
test: replace deprecated hydrate with hydrateRoot
1 parent ca31e2f commit 7f0bdbb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

csp-server/client.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { hydrate } from 'react-dom';
2+
import { hydrateRoot } from 'react-dom/client';
33
import App from './app';
44

55
const root = document.getElementById('root');
@@ -12,5 +12,5 @@ if (cspEl) {
1212
}
1313

1414
if (root) {
15-
hydrate(<App nonce={nonce} />, root);
15+
hydrateRoot(root, <App nonce={nonce} />);
1616
}

test/unit/integration/server-side-rendering/client-hydration.spec.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import ReactDOM from 'react-dom';
2+
import { hydrateRoot } from 'react-dom/client';
33
import ReactDOMServer from 'react-dom/server';
44
import { invariant } from '../../../../src/invariant';
55
import { resetServerContext } from '../../../../src';
@@ -43,5 +43,5 @@ it('should support hydrating a server side rendered application', () => {
4343
el.innerHTML = serverHTML;
4444
getBodyElement().appendChild(el);
4545

46-
expect(() => ReactDOM.hydrate(<App />, el)).not.toThrow();
46+
expect(() => hydrateRoot(el, <App />)).not.toThrow();
4747
});

0 commit comments

Comments
 (0)