Skip to content

Commit

Permalink
docs: update react-window.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
cncolder committed Apr 5, 2020
1 parent 0dc4acf commit 1176743
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/react-window.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,26 @@ sidebar_label: react-window
---

## [react-window](https://github.com/bvaughn/react-window)

### 安装

`npm i react-window`

`npm i -D @types/react-window`

### 使用

```jsx
import React from 'react'
import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'
import { FixedSizeList } from 'react-window'

const { windowWidth, windowHeight } = Taro.getSystemInfoSync()

const Example = () => (
<FixedSizeList width={windowWidth} height={windowHeight} itemCount={1000} itemSize={35}>
{({ index, style }) => <View style={style}>Row {index}</View>}
</FixedSizeList>
)
```

0 comments on commit 1176743

Please sign in to comment.