Skip to main content

React Native Chat

✨ Features​

Actively maintained, New Architecture ready, built for the latest Reanimated / Gesture Handler.

         


Quick start​

npx expo install @kesha-antonov/react-native-chat react-native-reanimated react-native-gesture-handler react-native-safe-area-context react-native-keyboard-controller
import { useCallback, useState } from 'react'
import { Chat } from '@kesha-antonov/react-native-chat'

export function Example () {
const [messages, setMessages] = useState([
{
_id: 1,
text: 'Hello developer',
createdAt: new Date(),
user: { _id: 2, name: 'John Doe', avatar: 'https://placeimg.com/140/140/any' },
},
])

const onSend = useCallback((newMessages = []) => {
setMessages(previous => Chat.append(previous, newMessages))
}, [])

return <Chat messages={messages} onSend={onSend} user={{ _id: 1 }} />
}

That is the whole setup - everything below is optional.