|
@@ -22,6 +22,7 @@ This document lays out the current public properties and methods for the React N
|
22
|
22
|
- [`onMessage`](Reference.md#onmessage)
|
23
|
23
|
- [`onNavigationStateChange`](Reference.md#onnavigationstatechange)
|
24
|
24
|
- [`onContentProcessDidTerminate`](Reference.md#oncontentprocessdidterminate)
|
|
25
|
+- [`onScroll`](Reference.md#onscroll)
|
25
|
26
|
- [`originWhitelist`](Reference.md#originwhitelist)
|
26
|
27
|
- [`renderError`](Reference.md#rendererror)
|
27
|
28
|
- [`renderLoading`](Reference.md#renderloading)
|
|
@@ -578,6 +579,39 @@ url
|
578
|
579
|
|
579
|
580
|
---
|
580
|
581
|
|
|
582
|
+### `onScroll`[⬆](#props-index)<!-- Link generated with jump2header -->
|
|
583
|
+
|
|
584
|
+Function that is invoked when the scroll event is fired in the `WebView`.
|
|
585
|
+
|
|
586
|
+| Type | Required | Platform |
|
|
587
|
+| -------- | -------- | ----------------------- |
|
|
588
|
+| function | No | iOS, macOS, Android, Windows |
|
|
589
|
+
|
|
590
|
+Example:
|
|
591
|
+
|
|
592
|
+```jsx
|
|
593
|
+<Webview
|
|
594
|
+ source={{ uri: 'https://reactnative.dev' }}
|
|
595
|
+ onScroll={syntheticEvent => {
|
|
596
|
+ const { contentOffset } = syntheticEvent.nativeEvent
|
|
597
|
+ console.table(contentOffset)
|
|
598
|
+ }}
|
|
599
|
+/>
|
|
600
|
+```
|
|
601
|
+
|
|
602
|
+Function passed to `onScroll` is called with a SyntheticEvent wrapping a nativeEvent with these properties:
|
|
603
|
+
|
|
604
|
+```
|
|
605
|
+contentInset
|
|
606
|
+contentOffset
|
|
607
|
+contentSize
|
|
608
|
+layoutMeasurement
|
|
609
|
+velocity
|
|
610
|
+zoomScale
|
|
611
|
+```
|
|
612
|
+
|
|
613
|
+---
|
|
614
|
+
|
581
|
615
|
### `originWhitelist`[⬆](#props-index)<!-- Link generated with jump2header -->
|
582
|
616
|
|
583
|
617
|
List of origin strings to allow being navigated to. The strings allow wildcards and get matched against _just_ the origin (not the full URL). If the user taps to navigate to a new page but the new page is not in this whitelist, the URL will be handled by the OS. The default whitelisted origins are "http://*" and "https://*".
|