seatgeek / react-infinite

A browser-ready efficient scrolling container based on UITableView
Other
2.71k stars 274 forks source link

Why scrollTimeout is state? #228

Open jongmoon opened 7 years ago

jongmoon commented 7 years ago

First of all, I want to thank you for your great job.

I've checked performance for this component using Perf and I found needless render call.

Last tables means wasted time.

image

And It is caused by scrollTimeout is managed as a state. So I change this value as a Infinite's property.. this.scrollTimeout (from this.state.scrollTimeout).

As a result of above. I can remove needless render call. and I didn't recognize any abnormality after modifying.

But I wonder why scrollTimeout is managed as state instead of normal (private) variable. Thank you in advance.