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: docs/virtualview.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,13 +19,13 @@ When it is the descendent of a [`ScrollView`](scrollview), it gains additional v
19
19
</ScrollView>
20
20
```
21
21
22
-
A `VirtualView` without an ancestor`ScrollView` does not have any virtualization capabilities.
22
+
A `VirtualView` without an ancestor[`ScrollView`](scrollview) does not have any virtualization capabilities.
23
23
24
24
## Virtualization
25
25
26
26
When a `VirtualView` leaves the visible region of a [`ScrollView`](scrollview), it becomes hidden. When hidden, a `VirtualView` will cache its most recent layout and may unmount its children — a process called virtualization.
27
27
28
-
When a `VirtualView` returns to the visible region of a `ScrollView`, it becomes visible. When visible, its children are *guaranteed* to be rendered. This guarantee is maintained by blocking the main thread from rendering the next frame that would reveal the `VirtualView` until its children can be rendered.
28
+
When a `VirtualView` returns to the visible region of a [`ScrollView`](scrollview), it becomes visible. When visible, its children are *guaranteed* to be rendered. This guarantee is maintained by blocking the main thread from rendering the next frame that would reveal the `VirtualView` until its children can be rendered.
29
29
30
30
<imgsrc="/docs/assets/d_virtualview_modes.svg"width="700"alt="Diagram of VirtualView modes and thresholds." />
31
31
@@ -71,10 +71,10 @@ Invoked when the `VirtualView` changes how it renders its children.
71
71
72
72
If a callback is supplied, it may be invoked from different threads and priorities depending on the internal state change. This can be detected by checking the `mode` property on the event:
73
73
74
-
- If `mode` is `VirtualViewMode.Visible`, the callback is being invoked from the main thread with immediate priority.
75
-
- If `mode` is `VirtualViewMode.Prerender` or `VirtualViewMode.Hidden`, the callback is being invoked from a background thread with transition priority.
74
+
- If `mode` is [`VirtualViewMode.Visible`](#virtualviewmode), the callback is being invoked from the main thread with immediate priority.
75
+
- If `mode` is [`VirtualViewMode.Prerender`](#virtualviewmode) or [`VirtualViewMode.Hidden`](#virtualviewmode), the callback is being invoked from a background thread with transition priority.
76
76
77
-
The callback will never be invoked consecutively with the same `mode` value. However, there are few guarantees about sequencing of events. Also, the callback may never be invoked with `VirtualViewMode.Visible` even if it becomes visible, if the children were successfully prerendered.
77
+
The callback will never be invoked consecutively with the same `mode` value. However, there are few guarantees about sequencing of events. Also, the callback may never be invoked with [`VirtualViewMode.Visible`](#virtualviewmode) even if it becomes visible, if the children were successfully prerendered.
@@ -122,7 +122,7 @@ Argument supplied to [`onModeChange`](#onmodechange).
122
122
:::note
123
123
For example, if a `VirtualView` enters the visible region of a [`ScrollView`](scrollview)...
124
124
125
-
-`mode` would be `VirtualViewMode.Visible`
125
+
-`mode` would be [`VirtualViewMode.Visible`](#virtualviewmode)
126
126
-`thresholdRect` would describe the current scroll position of the nearest ancestor [`ScrollView`](scrollview)
127
127
-`targetRect` would be the layout of `target` that overlaps with `thresholdRect` (i.e. it is within the visible region of the [`ScrollView`](scrollview))
`VirtualView` initially renders its children as visible, even if it is initially obscured by an ancestor [`ScrollView`](scrollview). This is because when a component is initially rendered, the presence of an ancestor [`ScrollView`](scrollview) — let alone its size and scroll position — are unknown.
152
152
153
-
For advanced use cases, `createHiddenVirtualView` creates a component that renders an initially hidden `VirtualView` with the supplied estimated layout.
153
+
For advanced use cases, `createHiddenVirtualView()` creates a component that renders an initially hidden `VirtualView` with the supplied estimated layout.
0 commit comments