Problem
When I upgrade @sendbird/uikit-react from version 3.16.12 to 3.17.0, my usage of the GroupChannelList has an issue with re-rendering. Each time the onChannelSelect gets called to change the channel, it causes the component to flash the loading UI for a split second.
// If problem, please fill out the below. If question, please delete.
[UIKit Version]
3.17.0 and above
[Reproduction Steps]
function LiveChatLab() {
const [activeChannelUrl, setActiveChannelUrl] = useState<string | null>();
const [filter, setFilter] = useState<ChannelListQueryParamsType>({
includeFrozen: true,
includeMetaData: true,
includeEmpty: true,
publicChannelFilter: PublicChannelFilter.ALL,
order: GroupChannelListOrder.LATEST_LAST_MESSAGE,
});
const handleChannelSelect = useCallback((channel: any) => {
if (channel) {
setActiveChannelUrl(channel.url);
}
}, []);
const handleNewChatCreated = useCallback((channel: any) => {
if (channel) {
setActiveChannelUrl(channel.url);
}
}, []);
return (
<GroupChannelProvider channelUrl={activeChannelUrl ?? ''}>
<GroupChannelList
disableAutoSelect
channelListQueryParams={filter}
onChannelSelect={handleChannelSelect}
onChannelCreated={handleNewChatCreated}
/>
</GroupChannelProvider>
);
}
[Frequency]
Every time
[Current impact]
Cannot upgrade @sendbird/uikit-react