We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf2a1f0 commit 1f5b564Copy full SHA for 1f5b564
src/server/pure.ts
@@ -29,11 +29,13 @@ function createServerRenderer<TProps, TResult>(
29
if (container) {
30
throw new Error('The component can only be hydrated once')
31
} else {
32
- container = document.createElement('div')
33
- container.innerHTML = serverOutput
34
- act(() => {
35
- ReactDOM.hydrate(testHarness(renderProps), container!)
36
- })
+ if (typeof document !== 'undefined') {
+ container = document.createElement('div')
+ container.innerHTML = serverOutput
+ act(() => {
+ ReactDOM.hydrate(testHarness(renderProps), container!)
37
+ })
38
+ }
39
}
40
},
41
rerender(props?: TProps) {
0 commit comments