You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@GaylordP I also did some research on this, and come to the same conclusion. It's a bad idea to use useCallback for renderItem. First of all it's completely unnecessary since VirtualizedList is taking care of referential equality by itself. And secondly: by using useCallback you are executing more code and even preventing garbage collection. It's never a good idea to use useCallback for render functions.
@GaylordP if I use currying as you said in 1.2 then component will rerender everytime because inner function will be recreated everytime and props will be changed.i tried few days ago before reading above
@GaylordP I also did some research on this, and come to the same conclusion. It's a bad idea to use
useCallback
forrenderItem
. First of all it's completely unnecessary sinceVirtualizedList
is taking care of referential equality by itself. And secondly: by usinguseCallback
you are executing more code and even preventing garbage collection. It's never a good idea to useuseCallback
for render functions.