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
Does it make any sense to have this.state.data available in those handlers? In my case, it's relevant for implementing an infinite scroller, where each fetch adds to the previous data and I need to somehow merge it.
Yes, I tried that one. This leads to problems when calling loadMore() multiple times before it completes (which, e.g., when using react-virtualized, is normal, as the user is free to scoll on at full speed). You end up accessing old versions of data which have been updated since the call to loadMore.
Does it make any sense to have
this.state.data
available in those handlers? In my case, it's relevant for implementing an infinite scroller, where each fetch adds to the previous data and I need to somehow merge it.Here's how that would look like:
My current workaround is to pass a
getData()
function toloadMore()
from the component, which works, but isn't nice.On another note, I would like to have that
data
even in direct mapping functions (loadMore()
above), so I can do things like optimistic updates.And, 👍 for this very nice library, thank you for writing it!
The text was updated successfully, but these errors were encountered: