Skip to content

Commit 1176743

Browse files
committed
docs: update react-window.mdx
1 parent 0dc4acf commit 1176743

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

docs/react-window.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,26 @@ sidebar_label: react-window
55
---
66

77
## [react-window](https://github.com/bvaughn/react-window)
8+
9+
### 安装
10+
11+
`npm i react-window`
12+
13+
`npm i -D @types/react-window`
14+
15+
### 使用
16+
17+
```jsx
18+
import React from 'react'
19+
import Taro from '@tarojs/taro'
20+
import { View } from '@tarojs/components'
21+
import { FixedSizeList } from 'react-window'
22+
23+
const { windowWidth, windowHeight } = Taro.getSystemInfoSync()
24+
25+
const Example = () => (
26+
<FixedSizeList width={windowWidth} height={windowHeight} itemCount={1000} itemSize={35}>
27+
{({ index, style }) => <View style={style}>Row {index}</View>}
28+
</FixedSizeList>
29+
)
30+
```

0 commit comments

Comments
 (0)