stream-chat-react icon indicating copy to clipboard operation
stream-chat-react copied to clipboard

bug: multiple channels open with channel list causes re-render

Open kyleosborn opened this issue 1 year ago • 1 comments

Describe the bug

While using the channel list, if you render a separate channel component that isn't the "active channel", something as part of the channel list render causes those channel components to re-render and the context/hover menu to be blank with missing icons.

To Reproduce

Steps to reproduce the behavior:

  1. Load a page with a channel component where the channel is passed in manually
  2. Open / cause the channel list to render
  3. You will see the channel components re-render/flash
  4. Hover over a message and you will see missing context actions.

Expected behavior

Rendering the channel list alongside a channel component that is not controlled via the active channel (i.e channel prop passed in) shouldn't cause side effects.

Package version

  • stream-chat-react: 9.2.0
  • stream-chat: 6.7.3

Additional context

Our goal is to use the channel list as is, with the sorting, unread indicators etc but be able to render multiple channels on a page without issue.

Is there a way to use the channel list component purely as a list of channels, and manually setup each channel component where needed without it being linked to an 'active channel' or affected by the channel list context?

kyleosborn avatar Aug 16 '22 10:08 kyleosborn

Hi,

the current component architecture is more or less coupled through contexts, so the re-render you describe is not something we can realistically address without deep architectural changes.

Re-renders however are usually relatively fast and should not be visible to the user unless there's an unmount/remount. Can you try to reproduce the problem using this sandbox? We will look and see if there's anything we can do to help you.

petyosi avatar Aug 16 '22 13:08 petyosi

Closing for now as author of the issue did not provide any more context.

arnautov-anton avatar Feb 23 '23 09:02 arnautov-anton