Skip to content

Commit 2dc4ac2

Browse files
authored
Merge pull request #79 from Lodin/fix/ssr
Check for existence of window before calling it in SSR environment
2 parents a4239ff + 4340144 commit 2dc4ac2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Tree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ const generateNewTree = <
286286
let tempRecord: NodeRecord<TNodePublicState> | null = rootRecord;
287287

288288
const useIdleCallback =
289-
'requestIdleCallback' in window &&
289+
typeof 'requestIdleCallback' !== 'undefined' &&
290290
placeholder !== undefined &&
291291
// If placeholder is set to null and this is the first build, idle callback
292292
// won't be used. It is necessary for trees with async data which can be

0 commit comments

Comments
 (0)