/react-native-autorecyclerlistview

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

Primary LanguageTypeScriptMIT LicenseMIT

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