diff --git a/app/soapbox/components/scrollable_list.tsx b/app/soapbox/components/scrollable_list.tsx index 0361da981..e4dd8a2de 100644 --- a/app/soapbox/components/scrollable_list.tsx +++ b/app/soapbox/components/scrollable_list.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Virtuoso } from 'react-virtuoso'; +import { Virtuoso, Components } from 'react-virtuoso'; import PullToRefresh from 'soapbox/components/pull-to-refresh'; @@ -10,19 +10,15 @@ type Context = { listClassName?: string, } -type VComponent = { - context?: Context, -} - // NOTE: It's crucial to space lists with **padding** instead of margin! // Pass an `itemClassName` like `pb-3`, NOT a `space-y-3` className // https://virtuoso.dev/troubleshooting#list-does-not-scroll-to-the-bottom--items-jump-around -const Item: React.FC = ({ context, ...rest }) => ( +const Item: Components['Item'] = ({ context, ...rest }) => (
); // Ensure the className winds up here -const List = React.forwardRef((props, ref) => { +const List: Components['List'] = React.forwardRef((props, ref) => { const { context, ...rest } = props; return
; });