Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ const generateNewTree = <
let tempRecord: NodeRecord<TNodePublicState> | null = rootRecord;

const useIdleCallback =
'requestIdleCallback' in window &&
typeof requestIdleCallback !== 'undefined'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to add && to the condition

Suggested change
typeof requestIdleCallback !== 'undefined'
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
Expand Down