Skip to main content
This guide builds a single chat window — no conversation list. Users go directly into a one-to-one or group chat. Good for support chat, embedded widgets, or any focused messaging experience. This assumes you’ve already completed React Native CLI Integration (project created, UI Kit installed, init + login working).

What You’re Building

Three components stacked vertically:
  1. Chat header — displays recipient name, avatar, online status, and optional call buttons
  2. Message list — real-time chat history with scrolling
  3. Message composer — text input with media, emojis, and send button
No additional files to create — everything goes in App.tsx.

Step 1 — Update App.tsx

The app fetches a user (or group) on mount and renders the three message components.
App.tsx
Key points:
  • CometChat.getUser(UID) fetches the user object from the SDK — you need a real user object, not a manually constructed one
  • Pass either user or group to the message components, never both
  • The highlighted constants show where to set the UID or swap to group chat

Switching Between User and Group Chat

To load a group chat instead of one-to-one, replace the getUser call with getGroup:
You can also determine this dynamically — for example, based on a route parameter or a selection from another part of your app.

Step 2 — Run the Project

You should see the chat window load with the conversation for the UID you set.

Next Steps

Theming

Customize colors, fonts, and styles to match your brand

Components Overview

Browse all prebuilt UI components

React Native CLI Integration

Back to the main setup guide

Core Features

Chat features included out of the box