Skip to content

Commit

Permalink
chore(app): try something...
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Jun 12, 2021
1 parent 4591450 commit d95c698
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions app/src/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const getMockData = (count: number, min = 25) =>
size: min + Math.round(Math.random() * 150),
}));

const mockData = getMockData(100);
const mockData = getMockData(10000);

export default (): JSX.Element => {
const { outerRef, innerRef, items, scrollToItem } = useVirtual<
Expand All @@ -131,9 +131,9 @@ export default (): JSX.Element => {
<div
key={index}
className={`${styles.item} ${index % 2 ? styles.dark : ""}`}
style={{ height: `${mockData[index].size}px` }}
// style={{ height: `${50}px` }}
ref={measureRef}
// style={{ height: `${mockData[index].size}px` }}
style={{ height: `${50}px` }}
// ref={measureRef}
>
{index}
</div>
Expand All @@ -142,11 +142,9 @@ export default (): JSX.Element => {
</div>
<button
type="button"
onClick={() =>
scrollToItem({ index: 50, align: "auto", smooth: true }, () =>
console.log("Done")
)
}
onClick={() => {
scrollToItem({ index: 1000, smooth: true }, () => console.log("Done"));
}}
>
Scroll To...
</button>
Expand Down

0 comments on commit d95c698

Please sign in to comment.