Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-component-infinite-scroll

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-component-infinite-scroll

React Component for Infinite Scrolling in a page

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by600%
Maintainers
1
Weekly downloads
 
Created
Source

Infinite Scroll React Component

This is a simple React Component for a Infinite Scrolling Page.

Nothing fancy, only a component that calls a passed function whenever a threshold from the bottom is reached.

Getting Started

Install react component:

npm install --save react-component-infinite-scroll

Import component in your file

import InfiniteScroll from 'react-component-infinite-scroll';

Use it in your component

class PageableList extends React.Component {
  static propTypes = {
    actions: React.PropTypes.object
  };

  nextPage() {                  // whatever method you want InfiniteScroll to call
    this.props.actions.fetchImages();
  }

  render() {
    return (
      <InfiniteScroll nextPage={ this.nextPage.bind(this) } threshold={ 600 } >
        <div className="list">
          <h1 className="title">List</h1>
          <VerticalList { ...this.props } />
        </div>
      </InfiniteScroll>
    );
  }
}

InfiniteScroll component will call the method passed in the nextPage prop whenever it hits the threshold from the bottom of the page. Which means that if the method updates the state, it will re-render the Component.

Keywords

FAQs

Package last updated on 16 Mar 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc