Skip to content
This repository was archived by the owner on Jun 17, 2026. It is now read-only.
This repository was archived by the owner on Jun 17, 2026. It is now read-only.

When I use onSend Props send two message in MessageInput how to fix? #133

Description

@junaid-junnu

using like this purpose is reactjs to react native app chat.

import {
  MessageInput
} from "@pubnub/react-chat-components"
const onSend = message => {
    const newMessage = [
      {
        createdAt: +new Date(),
        _id: `${generateUUID()}`,
        text: message?.text,
        type: "default",
        user: user
      }
    ]
    sendMessage(pubnub, selectMember?.id, newMessage[0])
  }

<MessageInput onSend={onSend} />

like this in the picture:

Screenshot from 2023-12-13 13-21-53

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions