Git Product home page Git Product logo

react-infinite-scroll's Introduction

react-infinite-scroll's People

Contributors

danbovey avatar guillaumervls avatar vjeux avatar zclark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-infinite-scroll's Issues

InfiniteScroll not defined

I'm getting this error:

Uncaught TypeError: Cannot read property '_defaultLoader' of undefined
React.addons.InfiniteScroll.React.createClass.getDefaultProps

Looks like InfiniteScroll isn't defined when it's used for InfiniteScroll._defaultLoader in getDefaultProps (fad3759)

Any ideas? I feel like I had this working fine before... Maybe something with React.createClass changed?

Close PR

Hi,

Thank you for this excellent react component!
I was looking for some improvements and I notice that there are some pending pull requests that do exactly what I was looking for.
Are you planning to execute and close them?

Cheers!

Does not work with ReactCSSTransitionGroup animation

If InfiniteScroll wrapped with ReactCSSTransitionGroup then transition does not work and if ReactCSSTransitionGroup wrapped with InfiniteScroll then InfiniteScroll scroll does not work. Later case it does work if window is resized. It seems scrollTop calculation giving higher value than threshold.

Doesn't work with a scrollable div (not a top level element)

Debugging this, it looks like some of the math is off. Looks like this doesn't work because you do you calculation based off of window height of height of the first node in the body. Can you just do these calculations off of the first child element?

React 0.14 support?

Now it produces warning

Unknown.getDOMNode(...) is deprecated. Please use ReactDOM.findDOMNode(instance) instead.

loader attribute

I see in the document that you write:

loader={{component:React.DOM.div, props:{className:'loader'}, children:'Loading ...'}}

Why don't you just take a React component as attribute?

loader={<div className="loader">Loading ...</div>}

That should be working fine

hasMore=false does not in fact detach the scrollListener

The docs state that hasMore=false will stop listening for scroll events. This isn't true if you update the component props to set hasMore=false. If it was true on initial load and you change it to false through props, the scrollHandler is still there. This has caused, in our case, a 2nd query to the service for the same page that you're currently on.

loadmore twice

Every time the loadmore event is triggered, it triggers two times

Uncaught TypeError: this.getDOMNode is not a function

When scrolling I'm getting an Uncaught TypeError: this.getDOMNode is not a function in below function

scrollListener: function () {
          var el = this.getDOMNode();
          var scrollTop = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
          if (topPosition(el) + el.offsetHeight - scrollTop - window.innerHeight < Number(this.props.threshold)) {
            this.detachScrollListener();
            // call loadMore after detachScrollListener to allow
            // for non-async loadMore functions
            this.props.loadMore(this.pageLoaded += 1);
          }

Keeps firing scrollListener

In attachScrollListener why do we fire scrollListener(), it causes load more without even any scroll or resize event happening ?

Support for bower

I understand how react itself uses browserify, but we have a repo that uses other stack and we use bower to manage dependencies.

Does this plugin supports React 16.2?

I am trying to use this plugin in my react 16.2 project, but it is giving following error:
screenshot from 2018-01-11 10 23 34

Does it support React 16.2, if not are there any chances that it will support React 16 in near future?

Solved: Problem with TransitionGroup

When using the TransitionGroup animation to transition from one page to another, I had a problem whereby the transition wasn't happening when InfiniteScroll was on the page.

I couldn't quite put my finger on what was causing it – although it seems to be caused by line 35, which is utterly bizarre, as that's a read-only line.

Nonetheless, I was able to fix it by monkey patching the componentDidMount and componentDidUpdate methods:

import IScroll from 'react-infinite-scroll';

// ...

const InfiniteScroll = IScroll(React);

// ...

InfiniteScroll.prototype.componentDidMount = function() {
    this.pageLoaded = this.props.pageStart;
    requestAnimationFrame(() => this.attachScrollListener());
};

InfiniteScroll.prototype.componentDidUpdate = function() {
    requestAnimationFrame(() => this.attachScrollListener());
};

getInitialState not used properly

Hello :)

shouldn't getInitialState be changed to componentWillMount ? getInitialState is supposed to set initial state and it is supposed to return value. Right now error occurs when you use getInitialState.

getInitialState: function () {
this.pageLoaded = this.props.pageStart;
}

====>

componentWillMount: function () {
this.pageLoaded = this.props.pageStart;
}

best,
J :)

Non-window infinite scroll

I'm looking to add infinite scroll to elements within a scrollable div. Is there a way to do this easily? Suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.