Description
Describe the bug
hasMore
from useChannelStateContext
doesn't reset when our channel is unmounted.
To Reproduce
When our channel has more than one page of messages, on first mount, hasMore
is true, as you would expect. We then lazy load messages as we scroll, until there are no more, then hasMore
is false.
Unmounting the channel component, and then remounting it, hasMore
is still false, despite our now having only the first page of messages from the channel. At this point, we cannot use hasMore
as a condition to lazyload the unloaded messages.
Expected behavior
hasMore
should reflect the current state of the the channel. In our case, I would expect it to reset when the component is unmounted, then remounted.
Package version
- stream-chat-react: 12.14.0
Desktop (please complete the following information):
- OS: latest macOS and iOS
- Browser: Chrome and Safari