Skip to content

bug: MessageList does not respond to stateful customActiveChannel prop after initial render #2656

Open
@lukewilson2002

Description

@lukewilson2002

I am trying to set the user's focused channel from a URL parameter once the page loads, and after the client has initialized. I get this channel URL and try to set the customActiveChannel value but it doesn't seem to update if it's a stateful value that starts undefined.

To Reproduce

Steps to reproduce the behavior:

  1. Create a stateful value: const [activeChannel, setActiveChannel] = useState<string | undefined>(undefined)
  2. Call setActiveChannel after the initial load and once MessageList has already received a prop of customActiveChannel = undefined
  3. After the value has been changed and the component is rendered, the MessageList won't have the channel selected and nothing has changed.

Expected behavior

The ChannelList should focus the channel with the id of customActiveChannel prop if it has changed.

Package version

  • stream-chat-react: 12.10.0
  • stream-chat-css:
  • stream-chat-js: 8.55

Desktop:

  • OS: macOS Silicon
  • Browser Chrome
  • Version 133

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions