1.0.1 • Published 4 years ago

react-native-recycler-view v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

react-native-recycler-view

IMPORTANT this module is for Android devices, will not work for IOS

npm.io

About

This is a Native module for React Native targeting Android platform, that utilizes Recycler View Api to bring you a list of card that performs well with huge amounts of data

Getting started

$ npm install react-native-recycler-view --save

Mostly automatic installation

$ react-native link react-native-recycler-view

Usage

  • import the module
  • supply it with height
  • pass the object array as data prop
  • make sure object has fields:
    • title: string
    • poster_url: string
    • _id: string
  • define an onClick event for the cards, you may get the id from the nativeInfoObject as shown below
import RecyclerView from 'react-native-recycler-view';

CardObjects = [{
  _id:"YourObjectId",
  poster_url: "url to the image you want to display to the card",
  title:"title to be displayed",
}]

<RecyclerView
  style={{height: 300}}
  data={CardObjects}
  onClick={(nativeInfoObj) => console.log(nativeInfoObj.nativeEvent.id)}
/>