react native gifted chat
import React, { useState, useCallback, useEffect } from 'react'
import { GiftedChat } from 'react-native-gifted-chat'
export function Example() {
const [messages, setMessages] = useState([]);
useEffect(() => {
setMessages([
{
_id: 1,
text: 'Hello developer',
createdAt: new Date(),
user: {
_id: 2,
name: 'React Native',
avatar: 'https://placeimg.com/140/140/any',
},
},
])
}, [])
const onSend = useCallback((messages = []) => {
setMessages(previousMessages => GiftedChat.append(previousMessages, messages))
}, [])
return (
<GiftedChat
messages={messages}
onSend={messages => onSend(messages)}
user={{
_id: 1,
}}
/>
)
}
Also in JavaScript:
- turn object to json javascript
- beautify json python
- conditional rendering alert if input fields are empty
- the red validation class doesn't apply on jquery
- react router dom npm
- gradle json simple dependency
- how to create duplicate key array in javascript
- variables 2 python .Bartolome sintes Marco
- jquery confirmation dialog example
- how to check if window size of browser s changed javascript
- universal apollo kit
- node js how to basic auth to specific urk
- how to make an alphabet in javascript
- javascript .tolowercase
- how to check if object exists in javascript
- jquery check if click to this self not this child
- post fetch call
- javascript foreach get key and value
- vue js cdn
- js detect mobile
- npm package for sorting in reactjs
- random numbers javascript
- javaascript all
- input output ionic