Programmatically set channel in Channel List (v3 beta.2)

Currently using v3 beta.2 UI Kit.

Is there a way to programmatically set the channel that’s highlighted in the Channel List?

I had thought that assigning the channelUrl to a variable in the ChannelList component would change it but I’m not seeing any action.

It looks like internally the Channel List is using this dispatch action on user click of a channel from the list (sendbird-uikit-react/reducers.js at develop-v3 · sendbird/sendbird-uikit-react · GitHub) but I don’t see a clean way to do the same in my code.

1 Like

I have also encountered this same issue. We have a custom api that we call to create channels and would like to programmatically set that particular channel to be selected once the request is completed. Is there any word on this @Yongjun_Choi ?

The ability to pass in a channelUrl into the channelList component would be helpful.

1 Like

@Alex_Maldonado Hi
It is possible to disable the selection of the first channel automatically, but I checked with the engineer in charge that the method of setting the channel through prop is not currently available.

@Yongjun_Choi Okay thanks for all your help recently. Greatly appreciated! We will try some workaround solutions for the time being.

I was just coming here to ask this same question. We wanted to programmatically set the selected channel to null (so, “unset the selected channel”) We were hoping we could do this by getting to the channelListDispatcher through useChannelListContext() but it’s not available

We need this too, any idea of providing such API? Or workarounds?

@Alex_Maldonado Have you found a workaround at this point?

There is currently no way to set the channel programmatically in the ChanneList. We do have an open feature request for this but it does not currently have an ETA.

1 Like