12.0.4 Updates
import { MeetlingLink } from 'react-chat-elements'
<MeetlingLink
actionButtons={[
{
onClickButton: test => {
console.log(test)
},
Component: () => <div>Test</div>,
},
{
onClickButton: test => {
console.log(test)
},
Component: () => <div>Test</div>,
},
]}
.
.
.
/>
import { MessageList } from 'react-chat-elements'
<MessageList
actionButtons={[
{
onClickButton: test => {
console.log(test)
},
Component: () => <div>Test</div>,
},
{
onClickButton: test => {
console.log(test)
},
Component: () => <div>Test</div>,
},
]}
.
.
.
/>
11.0.0 Updates
This update target to fix component ref broken problems
Fixed issues:
-
All react-chat-elements components turneded to function component for "ref" property problems.
-
In the Input component
referance={...}
instead of useref={...}
-
10.16.2 and before vesion usage
Before usage: this.refs.input.clear();
After 11.0.0 version usage is:
import { Input } from 'react-chat-elements' <Input ref='input' placeholder="Type here..." multiline={true} . . . />
New usage in class component: clearRef();
import { Input } from 'react-chat-elements' let clearRef = () => {}; this.inputReferance = React.createRef(); <Input referance={this.inputReferance} clear={(clear) => clearRef = clear} placeholder="Type here..." multiline={true} . . . />
New usage in function component: clearRef();
import { Input } from 'react-chat-elements' let clearRef = () => {}; const inputReferance = React.useRef(); <Input referance={inputReferance} clear={(clear) => clearRef = clear} placeholder="Type here..." multiline={true} . . . />
-
In the MessageList component usage
referance={...}
instead of useref={...}
Class Component:
import { MessageList } from 'react-chat-elements' this.messageList = React.createRef(); <MessageList referance={this.messageList} className='message-list' lockable={true} toBottomHeight={'100%'} dataSource={[ { position: 'right', type: 'text', text: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit', date: new Date(), }, . . . ]} />
Function Component:
import { MessageList } from 'react-chat-elements' const messageListReferance = React.useRef(); <MessageList referance={messageListReferance} className='message-list' lockable={true} toBottomHeight={'100%'} dataSource={[ { position: 'right', type: 'text', text: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit', date: new Date(), }, . . . ]} />