2.1.0 • Published 8 years ago

react-native-scrollable-list v2.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

react-native-scrollable-list

Build Status NPM version Dependency Status Downloads

A ListView without the boilerplate.

Install

npm install --save react-native-scrollable-list

Usage

import ScrollableList from 'react-native-scrollable-list'
// other imports

const celebrities = [
    name: 'Leonardo Di Caprio',
    role: 'Actor',
  },
  {
    name: 'Luís Suárez',
    role: 'Football Player',
  },
  {
    name: 'Eddie Van Halen',
    role: 'Guitar Player',
  },
]

const Celebrity = ({name, role}) => (<Text>Name: {name}{\n}Role: {role}</Text>)

export default (<ScrollableList data={celebrities} renderRow={(data) => <Celebrity {...data} />} />)

That's it.

That will render a ListView, with all the dataSource, cloneWithRows, and all that boilerplate code nobody wants to write. And, when data changes, updates dataSource gracefully, without forcing re-rendering.

Props

First, check ListView's props. ScrollableList is compliant. If you want to pass any of the ListView props (like style, onEndReached, onChangeVisibleRows, etc), just pass them to ScrollableList, and they will reach ListView.

License

MIT © Nacho Álvarez

2.1.0

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.2.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago