From bd31f4ec4ec63aa21328510530ed074e86175d34 Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Fri, 14 Jun 2024 15:27:22 +0200 Subject: [PATCH] Update types again --- src/core/RecyclerListView.tsx | 5 +++-- src/core/scrollcomponent/BaseScrollComponent.tsx | 4 ++-- src/platform/reactnative/scrollcomponent/ScrollComponent.tsx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/RecyclerListView.tsx b/src/core/RecyclerListView.tsx index 7cd73da7..1cceadfe 100644 --- a/src/core/RecyclerListView.tsx +++ b/src/core/RecyclerListView.tsx @@ -41,7 +41,7 @@ import { ComponentCompat } from "../utils/ComponentCompat"; import ScrollComponent from "../platform/reactnative/scrollcomponent/ScrollComponent"; import ViewRenderer from "../platform/reactnative/viewrenderer/ViewRenderer"; import { DefaultJSItemAnimator as DefaultItemAnimator } from "../platform/reactnative/itemanimators/defaultjsanimator/DefaultJSItemAnimator"; -import { Platform, ScrollViewComponent } from "react-native"; +import { Platform, ScrollView } from "react-native"; const IS_WEB = !Platform || Platform.OS === "web"; //#endif @@ -54,6 +54,7 @@ const IS_WEB = !Platform || Platform.OS === "web"; //import ViewRenderer from "../platform/web/viewrenderer/ViewRenderer"; //import { DefaultWebItemAnimator as DefaultItemAnimator } from "../platform/web/itemanimators/DefaultWebItemAnimator"; //const IS_WEB = true; +//type ScrollView = unknown; //#endif /*** @@ -394,7 +395,7 @@ export default class RecyclerListView

| null { + public getNativeScrollRef(): ScrollView | null { if (this._scrollComponent && this._scrollComponent.getNativeScrollRef) { return this._scrollComponent.getNativeScrollRef(); } diff --git a/src/core/scrollcomponent/BaseScrollComponent.tsx b/src/core/scrollcomponent/BaseScrollComponent.tsx index 2e4958bb..ee2952ad 100644 --- a/src/core/scrollcomponent/BaseScrollComponent.tsx +++ b/src/core/scrollcomponent/BaseScrollComponent.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { ScrollViewComponent } from "react-native"; +import { ScrollView } from "react-native"; import { Dimension } from "../dependencies/LayoutProvider"; import BaseScrollView, { ScrollEvent, ScrollViewDefaultProps } from "./BaseScrollView"; @@ -28,7 +28,7 @@ export default abstract class BaseScrollComponent extends React.Component | null { + public getNativeScrollRef(): ScrollView | null { return null; } } diff --git a/src/platform/reactnative/scrollcomponent/ScrollComponent.tsx b/src/platform/reactnative/scrollcomponent/ScrollComponent.tsx index 9dd0939e..74e310ad 100644 --- a/src/platform/reactnative/scrollcomponent/ScrollComponent.tsx +++ b/src/platform/reactnative/scrollcomponent/ScrollComponent.tsx @@ -50,7 +50,7 @@ export default class ScrollComponent extends BaseScrollComponent { return null; } - public getNativeScrollRef(): React.ElementRef | null { + public getNativeScrollRef(): ScrollView | null { return this._scrollViewRef; }