Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 638 Bytes

react-window.mdx

File metadata and controls

28 lines (21 loc) · 638 Bytes
id title sidebar_label
react-window
react-window
react-window

需求

  • requestAnimationFrame

使用

import React from 'react'
import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'
import { FixedSizeList } from '@tarojsx/library/dist/react-window'

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

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