react-chat-api-component-test

0.0.1 • Public • Published

React Color Component

Status

Incompleted version

Installation

npm install --save react-chat-api-component-test

How To Use

First import this component where you want to use it

import {withChatkitOneToOne} from "react-chat-api-component-test"

Props

Prop Description Default value Type
roomID Sets Room ID(requied) None string
roomName Sets Room Name(requied) None string
userID Sets User ID(requied) None string
userName Sets User Name(requied) None string

Example

import React from 'react';
import {withChatkitOneToOne} from 'react-chat-api-component-test';

function Chat(props) {
  const [message, setMessage] = React.useState('');
  function sendMessage() {
    const msgContent = {
        type: 'text',
        message: message
    }
    props.chatkit.sendSimpleMessage(msgContent)
  }
  function messageChange(e) {
    setMessage(e.target.value);
    props.chatkit.typeing();
  }
  React.useEffect(() => {
  }, [props])
  
  return (
    <div className="App">
        <input type="text" value={message} onChange={(e) => {messageChange(e)}} />
        <button onClick={sendMessage}>send</button>
    </div>
  );
}
export default withChatkitOneToOne(Chat);

/react-chat-api-component-test/

    Package Sidebar

    Install

    npm i react-chat-api-component-test

    Weekly Downloads

    2

    Version

    0.0.1

    License

    ISC

    Unpacked Size

    122 kB

    Total Files

    3

    Last publish

    Collaborators

    • blue1107