diff --git a/src/Tree.tsx b/src/Tree.tsx index 9529601..d24d149 100644 --- a/src/Tree.tsx +++ b/src/Tree.tsx @@ -286,7 +286,7 @@ const generateNewTree = < let tempRecord: NodeRecord | null = rootRecord; const useIdleCallback = - 'requestIdleCallback' in window && + typeof requestIdleCallback !== 'undefined' placeholder !== undefined && // If placeholder is set to null and this is the first build, idle callback // won't be used. It is necessary for trees with async data which can be