Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

Commit 12fe382

Browse files
authored
fix: portal SSR (#231)
1 parent 80ceda7 commit 12fe382

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Tippy.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ssrSafeCreateDiv,
66
toDataAttributes,
77
deepPreserveProps,
8+
isBrowser,
89
} from './utils';
910
import {useMutableBox, useIsomorphicLayoutEffect} from './util-hooks';
1011
import {classNamePlugin} from './className-plugin';
@@ -209,10 +210,13 @@ export default function TippyGenerator(tippy) {
209210
},
210211
})
211212
: null}
212-
{createPortal(
213-
render ? render(toDataAttributes(attrs), singletonContent) : content,
214-
mutableBox.container,
215-
)}
213+
{isBrowser &&
214+
createPortal(
215+
render
216+
? render(toDataAttributes(attrs), singletonContent)
217+
: content,
218+
mutableBox.container,
219+
)}
216220
</>
217221
);
218222
}

0 commit comments

Comments
 (0)