Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerWhitehead7 committed Oct 9, 2024
1 parent 5a835c4 commit bc8ed0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/virtual/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type VirtualListReturn<T extends readonly any[]> = [
{
containerHeight: Accessor<number>;
viewerTop: Accessor<number>;
visibleItems: Accessor<readonly T[]>;
visibleItems: Accessor<T>;
},
onScroll: (
e: Event & {
Expand Down Expand Up @@ -58,7 +58,7 @@ export function createVirtualList<T extends readonly any[]>({
{
containerHeight: () => items.length * rowHeight,
viewerTop: () => getFirstIdx() * rowHeight,
visibleItems: () => items.slice(getFirstIdx(), getLastIdx()),
visibleItems: () => items.slice(getFirstIdx(), getLastIdx()) as unknown as T,
},
e => {
setOffset(e.target.scrollTop);
Expand Down Expand Up @@ -117,7 +117,7 @@ export function VirtualList<T extends readonly any[], U extends JSX.Element>(
top: `${viewerTop()}px`,
}}
>
<For fallback={props.fallback} each={visibleItems() as unknown as T}>
<For fallback={props.fallback} each={visibleItems()}>
{props.children}
</For>
</div>
Expand Down

0 comments on commit bc8ed0a

Please sign in to comment.