Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error [mobx] Out of bounds read: 5 when using mobx #2470

Open
muramidaza opened this issue Dec 20, 2023 · 0 comments
Open

Error [mobx] Out of bounds read: 5 when using mobx #2470

muramidaza opened this issue Dec 20, 2023 · 0 comments

Comments

@muramidaza
Copy link

muramidaza commented Dec 20, 2023

Hello! Im using GiftedChat 2.4.0 with mobx:

The component renders chat:

  return (
    <GiftedChat
      messages={chatStore.messages}
      renderBubble={renderBubble}
      onSend={(messages: any) => onSend(messages)}
      user={{
        _id: 1,
      }}
    />
  );

Chat store:

export class ConsultationsStore {

  constructor() {
    makeAutoObservable(this);
  }

  messages: any[] = [];


  addMessage = (message: string, sender: string) => {
    const chatMessage = {
      _id: Math.round(Math.random() * 100000000),
      text: message,
      createdAt: new Date(),
      user: {
        _id: 1,
        name: sender
      }
    }
    this.messages.unshift(chatMessage);
  }
}

When receiving messages from webrtc and adding them through addMessages, the messages are added normally. But there's an error [mobx] Out of bounds read

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant