react-infinite
react-infinite copied to clipboard
scrolling isn't hardware accelerated due to hooking onScroll event
To address this we can't hook the onScroll event. I think we could poll the scroll state in a timeout, or on requestAnimationFrame or every 100ms or something. Just need to configure a wide-enough visible range, so 100ms of scrolling doesn't go past the visible elements. I may be wrong, I haven't given this enough thought yet.
I can feel the difference removing the onScroll hook on my 2014 macbook pro in chrome canary - things feel snappier and slightly less clicky. The effect is minor - I never noticed the degraded perf before.
I am attempting to address this in my fork - if i get it working, this fix can probably be back-ported.
:+1: I think requestAnimationFrame might be the way to go here.
@dustingetz did you make a pull request? I would be interested in checking it out.
I haven't had time to submit a PR to this project, but you can see what I did in my fork here: https://github.com/dustingetz/react-infinite/blob/master/src/react-infinite2.jsx#L93
I will eventually submit a PR to this project, its just may be a month or two.
Cool, thanks for the update. I will keep one eye on the project!
On Thu, Sep 17, 2015 at 9:38 AM, Dustin Getz [email protected] wrote:
I will eventually submit a PR to this project, its just may be a month or two.
— Reply to this email directly or view it on GitHub https://github.com/seatgeek/react-infinite/issues/63#issuecomment-141106740 .
I'd really like to get this in as well. We're a little busy at the moment, but I'll try and get some time to do it soon.
+1 for implementing requestAnimationFrame
ugh, this is almost a year old, no progress?
@jasongonzales23 submit a PR if it's important enough to lament with an 'ugh' brah.
Fair enough, apologies, was just having a very frustrating day at the time. If you're in SF I'd be happy to buy you a beer or two to make it up to you 🍻
@jasongonzales23 No worries. I'm just a troll who uses this project, not the author and I've been there. If you're in Chicago I will buy you a beer.
See, we aren't a country divided afterall. Take that politicians...