diff --git a/src/RawList/index.tsx b/src/RawList/index.tsx index e70b36d..facb150 100644 --- a/src/RawList/index.tsx +++ b/src/RawList/index.tsx @@ -132,6 +132,11 @@ function RawList( ); } -const RawListWithRef = React.forwardRef(RawList as any) as any; +const RawListWithRef = React.forwardRef(RawList) as < + T, + K extends React.Key = React.Key, +>( + props: RawListProps & { ref?: React.Ref }, +) => React.ReactElement; export default RawListWithRef; diff --git a/src/RawList/useRawListScroll.ts b/src/RawList/useRawListScroll.ts index b2463f4..af6ba93 100644 --- a/src/RawList/useRawListScroll.ts +++ b/src/RawList/useRawListScroll.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import type { ListyRef, PositionScrollToConfig, ScrollAlign } from '../List'; +import type { ListyRef, ScrollAlign } from '../List'; export default function useRawListScroll( ref: React.Ref, @@ -87,7 +87,7 @@ export default function useRawListScroll( return; } - const { left, top } = config as PositionScrollToConfig; + const { left, top } = config; if (left !== undefined) { holder.scrollLeft = left; } diff --git a/src/VirtualList/index.tsx b/src/VirtualList/index.tsx index dfa9eaa..e2cd833 100644 --- a/src/VirtualList/index.tsx +++ b/src/VirtualList/index.tsx @@ -197,6 +197,11 @@ function VirtualList( ); } -const VirtualListWithRef = React.forwardRef(VirtualList as any) as any; +const VirtualListWithRef = React.forwardRef(VirtualList) as < + T, + K extends React.Key = React.Key, +>( + props: VirtualListProps & { ref?: React.Ref }, +) => React.ReactElement; export default VirtualListWithRef;