We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7362270 commit 23a2cadCopy full SHA for 23a2cad
1 file changed
docs/examples/ssr.tsx
@@ -1,7 +1,7 @@
1
import { clsx } from 'clsx';
2
import CSSMotion, { genCSSMotion } from 'rc-motion';
3
import React from 'react';
4
-import { hydrate } from 'react-dom';
+import { hydrateRoot } from 'react-dom/client';
5
import ReactDOMServer from 'react-dom/server';
6
import './basic.less';
7
@@ -44,9 +44,10 @@ const App = () => {
44
document.body.appendChild(div);
45
div.innerHTML = ssr;
46
47
- hydrate(<MotionAppear supportMotion />, div);
+ const root = hydrateRoot(div, <MotionAppear supportMotion />);
48
49
return () => {
50
+ root.unmount();
51
document.body.removeChild(div);
52
};
53
}, []);
0 commit comments