diff --git a/examples/basic.tsx b/examples/basic.tsx index 5d50c92a..2f14a202 100644 --- a/examples/basic.tsx +++ b/examples/basic.tsx @@ -1,18 +1,17 @@ -/* eslint-disable jsx-a11y/label-has-associated-control, jsx-a11y/label-has-for */ import * as React from 'react'; -import List, { ListRef } from '../src/List'; +import List, { type ListRef } from '../src/List'; import './basic.less'; interface Item { - id: string; + id: number; } const MyItem: React.ForwardRefRenderFunction = ({ id }, ref) => ( { console.log('Click:', id); @@ -35,7 +34,7 @@ class TestItem extends React.Component { const data: Item[] = []; for (let i = 0; i < 1000; i += 1) { data.push({ - id: String(i), + id: i, }); } @@ -44,7 +43,7 @@ const TYPES = [ { name: 'ref react node', type: 'react', component: TestItem }, ]; -const onScroll: React.UIEventHandler = e => { +const onScroll: React.UIEventHandler = (e) => { console.log('scroll:', e.currentTarget.scrollTop); }; @@ -160,7 +159,7 @@ const Demo = () => { type="button" onClick={() => { listRef.current.scrollTo({ - key: '50', + key: 50, align: 'auto', }); }} @@ -171,7 +170,7 @@ const Demo = () => {