lngdao / react-native-autorecyclerlistview

AutoRecyclerListView inspired by recyclerListView and react-native-autoscroll-flatlist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-autorecyclerlistview

AutoRecyclerListView inspired by recyclerListView and react-native-autoscroll-flatlist

Installation

# Using yarn

 yarn add react-native-autorecyclerlistview

# Using npm

 npm i react-native-autorecyclerlistview

Demo

Code provided in example folder.

Usage

...
import AutoRecyclerListView, { ListAutoRenderItem } from 'react-native-autorecyclerlistview'

const Sample = () => {
  const [data, setData] = useState<string[]>([])

  useEffect(() => {
    setInterval(() => {
      setData((prev) => [...prev, 'Hello world!'])
    }, 1000)
  }, [])

  const _renderItem: ListAutoRenderItem<string> = ({ item, index }) => {
    return (
      <View>
        <Text children={item} />
      </View>
    )
  }

  return (
    <View style={{ flex: 1 }}>
      <AutoRecyclerListView data={data} renderItem={_renderItem} />
    </View>
  )
}
...

Props

Updating...

License

MIT

About

AutoRecyclerListView inspired by recyclerListView and react-native-autoscroll-flatlist

License:MIT License


Languages

Language:TypeScript 54.3%Language:Kotlin 22.5%Language:JavaScript 8.7%Language:Swift 7.7%Language:Ruby 3.2%Language:Starlark 2.7%Language:Objective-C 0.9%