I’m currently using "sendbird-uikit": "^2.3.2-alpha"
in my project, and I am using ChannelList, as such:
<ChannelList onChannelSelect={(channel) => {
this.props.selectedChannel(channel);
}}
/>
What’s happening is that when I create one group channel and then leave that channel, my React app immediately crashes saying that ChannelList is looking for url
but it is undefined.
I’m seeing that the error comes from this area, SendBird-UIKIT-JavaScript/ChannelList.js at master · sendbird/SendBird-UIKIT-JavaScript · GitHub.
For more information, this is the error:
TypeError: Cannot read property 'url' of undefined
The stack trace is as such (in reducer.js
):
107 | const filteredChannels = state.allChannels.filter((c) => c.url !== channel.url);
108 | return {
109 | ...state,
> 110 | currentChannel: (isMe && (channel.url === state.currentChannel))
| 111 | ? filteredChannels[0].url
112 | : state.currentChannel,
113 | allChannels: filteredChannels,
Also,
ChannelList
src/smart-components/ChannelList/index.jsx:69
66 | const sdkError = sdkStore.error;
67 | const sdkIntialized = sdkStore.initialized;
68 |
> 69 | const [channelListStore, channelListDispatcher] = useReducer(
| 70 | channelListReducers,
71 | channelListInitialState,
72 | );
Is this a bug, or something on my side?