Skip to content

Commit d4908d2

Browse files
authored
Update SSR render check
1 parent 08e5ac1 commit d4908d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/HighchartsReact.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ import React, {
1313
// `Highcharts` ref is available in the layout phase. This makes it available
1414
// in a parent component's `componentDidMount`.
1515
const useIsomorphicLayoutEffect =
16-
typeof window !== 'undefined' ? useLayoutEffect : useEffect;
16+
typeof window !== 'undefined' && typeof window.document !== 'undefined'
17+
? useLayoutEffect
18+
: useEffect;
1719

1820
export const HighchartsReact = memo(forwardRef(
1921
function HighchartsReact(props, ref) {

0 commit comments

Comments
 (0)