Skip to content

Can't scroll on component mount  #430

@LauraBeatris

Description

@LauraBeatris

I have the following function to scroll to the bottom of the container

  const scrollChatToBottom = useCallback(() => {
    animateScroll.scrollToBottom({
      containerId: "event-chat-messages",
    });
  }, []);

And I want to execute that function on the component mount

  useEffect(() => {
    scrollChatToBottom();
  }, [
    scrollChatToBottom,
  ]);

But it's not working, is there a reason to that happen?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions