Hallo all and thank you for this great work :)
I was trying out react-window in a personal project and noticed that if I specify an itemKey function and put a console.log there and return a key value, this function runs tens of times for every little scroll, causing some junk (at least in development mode). Am I doing something wrong? I noticed a similar behaviour if I just slightly edit one of the demo sandbox https://codesandbox.io/s/trusting-wave-v4tjy
Thank you!
It's expected that this function is called many times per scroll. It's called at least once per item rendered.
Not sure what "junk" it causes? Mapping index to ID should be very fast?
itemKey should not be the bottleneck, try to simply remove the console.log and see if that make a difference :)
Yeah, to clarify. Running multiple times doesn't indicate a problem. This function should be very fast.
yes I think the junk was caused by Firefox dev tools being slow at logging, I just wanted to be sure I was not messing up with some parameters that would cause that function to run more then needed.
thank you all so much for answering so quickly :)