Przeglądaj źródła

Fix onScroll event type

Nizomiddin Toshpulatov 4 lat temu
rodzic
commit
030d96bf65
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4
    2
      src/WebViewTypes.ts

+ 4
- 2
src/WebViewTypes.ts Wyświetl plik

@@ -167,6 +167,8 @@ export type WebViewHttpErrorEvent = NativeSyntheticEvent<WebViewHttpError>;
167 167
 
168 168
 export type WebViewRenderProcessGoneEvent = NativeSyntheticEvent<WebViewRenderProcessGoneDetail>;
169 169
 
170
+export type WebViewScrollEvent = NativeSyntheticEvent<NativeScrollEvent>;
171
+
170 172
 export type DataDetectorTypes =
171 173
   | 'phoneNumber'
172 174
   | 'link'
@@ -259,7 +261,7 @@ export interface CommonNativeWebViewProps extends ViewProps {
259 261
   javaScriptCanOpenWindowsAutomatically?: boolean;
260 262
   mediaPlaybackRequiresUserAction?: boolean;
261 263
   messagingEnabled: boolean;
262
-  onScroll?: (event: NativeScrollEvent) => void;
264
+  onScroll?: (event: WebViewScrollEvent) => void;
263 265
   onLoadingError: (event: WebViewErrorEvent) => void;
264 266
   onLoadingFinish: (event: WebViewNavigationEvent) => void;
265 267
   onLoadingProgress: (event: WebViewProgressEvent) => void;
@@ -905,7 +907,7 @@ export interface WebViewSharedProps extends ViewProps {
905 907
   /**
906 908
    * Function that is invoked when the `WebView` scrolls.
907 909
    */
908
-  onScroll?: (event: NativeScrollEvent) => void;
910
+  onScroll?: (event: WebViewScrollEvent) => void;
909 911
 
910 912
   /**
911 913
    * Function that is invoked when the `WebView` has finished loading.