Socket
Book a DemoInstallSign in
Socket

infinite-scroll-x

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

infinite-scroll-x

Infinite Scroll View React Native

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

InfiniteScroll

React native scroll view (infnite). This is a really working react native infinite scroll view component. Compatable with both IOS & Android. Fine with all react native versions.

Install

npm i infinite-scroll-x --save

Usage

<InfiniteScroll
	onLoadMoreAsync={this.loadMorePage()}
	horizontal={false}  //true - if you want in horizontal
	style={styles.scrollView}
	{...prop}
	>
{...children}
</InfiniteScroll>

Example

var React = require('react');
var {
	Text,
	ListView
} = require('react-native');
var InfiniteScroll = require('infinite-scroll-x');

var Example = React.createClass({
	getInitialState(){
		var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
		var rows = ["China","Korea","Singapore","Malaysia"]
		return {
			data: rows,
			dataSource: ds.cloneWithRows(rows)
		}
	},
	loadMorePage(){
		//here .. collect the data from server somehow
		let new_data = ['Japan','Myanmar','India','Thailand'];
		let rows = this.state.data;
		rows.push.apply(rows, new_data);
		this.setState({
			data: rows,
			dataSource: this.state.dataSource.cloneWithRows(rows)
		});
	},
	render(){
		return (
			<InfiniteScroll
			horizontal={false}	//true - if you want in horizontal
			onLoadMoreAsync={this.loadMorePage()}
			style={styles.scrollView}>
			          <ListView
					enableEmptySections={true}
					dataSource={this.state.dataSource}
					renderRow={(data)=><Text>{data}</Text>}
					/>
		        </InfiniteScroll>
		);
	}
});


module.exports = Example

Support on Beerpay

Hey dude! Help me out for a couple of :beers:!

Beerpay Beerpay

Keywords

infinite

FAQs

Package last updated on 16 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts