You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,7 @@ It receives the following props:
166
166
- All fields of the [`FixedSizeNodePublicState`](#types) object.
167
167
-`treeData: any` - any data provided via the `itemData` property of the `FixedSizeTree` component.
168
168
169
-
##### `placeholder: ReactNode`
169
+
##### `placeholder: ReactNode | null`
170
170
171
171
This property receives any react node that will be displayed instead of a tree during the building process. This option should only be used if the tree building process requires too much time (which means you have a really giant amount of data, e.g. about a million nodes).
172
172
@@ -176,6 +176,10 @@ Using this feature allows avoiding UI freezes; however, it may slightly increase
176
176
177
177
To see how it works, you can check the [BigData](./__stories__/BigData.story.tsx) story. Use `placeholder` tool to add and remove placeholder.
178
178
179
+
If you have an asynchronous giant tree and want to use profits of `requestIdleCallback` but don't want placeholder to be shown on the first render (that is probably quite small because all other data will be loaded asynchronously), set `placeholder` to `null`. No placeholder will be shown on the first render but the `requestIdleCallback` building will be enabled and allow avoiding freezes on tree re-building when tree becomes bigger.
180
+
181
+
To see how it works you can check the [AsyncDataIdle](./__stories__/AsyncDataIdle.story.tsx) story. It uses the `null` placeholder, so no text is shown for the first build but async requests don't block the UI.
182
+
179
183
##### `buildingTaskTimeout: number`
180
184
181
185
This option works in tandem with the `placeholder` option. With it, you can set the task timeout for the `requestIdleCallback`. The `buildingTaskTimeout` will be sent directly as the `requestIdleCallback`'s `timeout` option.
0 commit comments