chatkit-react-api

0.0.3 • 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);

Package Sidebar

Install

npm i chatkit-react-api

Weekly Downloads

6

Version

0.0.3

License

ISC

Unpacked Size

123 kB

Total Files

3

Last publish

Collaborators

  • blue1107