A high-fidelity iMessage clone built with React Native, Expo SDK 54, and the New Architecture (Fabric). Features smooth animations, optimistic updates, dark/light theme support, and simulated NPC responses.
- ๐ฌ iMessage-style UI - Authentic Apple iMessage design and animations
- ๐ High Performance - Built with React Native New Architecture (Fabric)
- ๐จ Smooth Animations - Spring-based entrance animations for messages
- ๐ Dark/Light Theme - Full support for system theme preferences
- ๐ญ Typing Indicator - Animated three-dot typing indicator
- ๐ค Simulated NPC Responses - Automatic replies after sending messages
- ๐ฑ Optimistic Updates - Instant message feedback with TanStack Query
- โพ๏ธ Infinite Scroll - Pagination for loading message history
- ๐ฏ Type Safe - Full TypeScript support throughout
- Framework: Expo SDK 54 with React Native 0.81
- Architecture: React Native New Architecture (Fabric) enabled
- State Management: TanStack Query v5 for server state
- Routing: Expo Router v6
- Language: TypeScript
- Package Manager: pnpm
- Node.js 18 or higher
- pnpm (or npm/yarn)
- iOS Simulator (Xcode) or Android Emulator
# Clone the repository
git clone https://github.com/temporarystudios/react-native-imessage.git
cd react-native-imessage
# Install dependencies
pnpm install
# Start the development server
pnpm start# Start Expo development server
pnpm start
# Run on iOS
pnpm ios
# Run on Android
pnpm android
# Run on Web
pnpm webrn-imessage/
โโโ app/ # App screens (Expo Router)
โ โโโ _layout.tsx # Root layout with QueryClientProvider
โ โโโ (tabs)/
โ โโโ index.tsx # Main chat screen
โโโ components/ # Reusable components
โ โโโ typing-indicator.tsx # Animated typing indicator
โโโ lib/ # Business logic
โ โโโ api/
โ โ โโโ messages.ts # Mock API functions
โ โโโ hooks/
โ โโโ useMessages.ts # React Query hooks
โโโ modules/ # Native modules
โ โโโ expo-chat-message-list/ # Custom native message list
โโโ assets/ # Static assets
โโโ constants/ # App constants
The main chat interface featuring:
- iMessage-style header with avatar
- Message list with custom bubbles
- Animated message entrance
- Input bar with send button
- Typing indicator integration
- NPC auto-response simulation
- Dark/light theme support
Reusable component showing animated typing status:
- Three bouncing dots with staggered animation
- Proper cleanup on unmount
- Self-contained styling
- Theme-aware colors
Custom React Query hooks:
useMessages()- Infinite query for paginated message historyuseSendMessage()- Mutation with optimistic updates
Light Mode:
- User messages: Blue (#007AFF), right-aligned, white text
- Other messages: Light gray (#E9E9EB), left-aligned, black text
Dark Mode:
- User messages: Blue (#0A84FF), right-aligned, white text
- Other messages: Dark gray (#3A3A3C), left-aligned, white text
Layout:
- Border radius: 20pt for smooth rounded corners
- Max width: 70% of screen width
- Font: 17pt with -0.2 letter spacing
Background: #F7F7F7
Header: #FFFFFF
User Bubble: #007AFF
Other Bubble: #E9E9EB
Input Background: #FFFFFF
Input Border: #D1D1D6
Text (Primary): #000000
Text (Secondary): #8E8E93Background: #000000
Header: #1C1C1E
User Bubble: #0A84FF
Other Bubble: #3A3A3C
Input Background: #1C1C1E
Input Border: #38383A
Text (Primary): #FFFFFF
Text (Secondary): #8E8E93- Message entrance: Spring animation (tension: 180, friction: 12)
- Send button: Scale animation (0.88 on press)
- Typing dots: Vertical bounce (-8px, 400ms duration, 150ms delay between dots)
The project uses React Native's New Architecture (Fabric):
// app.json
{
"expo": {
"newArchEnabled": true,
"userInterfaceStyle": "automatic"
}
}React 19 compiler is enabled for automatic memoization:
{
"experiments": {
"reactCompiler": true
}
}The app automatically adapts to system theme preferences. Themes can be toggled in:
- iOS: Settings โ Display & Brightness
- Android: Settings โ Display โ Dark theme
Colors dynamically update using useColorScheme() hook.
After sending a message, the app simulates a response:
- Wait 1 second
- Show typing indicator for 2 seconds
- Display random NPC response from predefined phrases:
- "That's interesting!"
- "Tell me more"
- "I see what you mean"
- "Absolutely!"
- "That makes sense"
- "I was thinking the same thing"
- "Good point!"
- "Interesting perspective"
# Development
pnpm start # Start Expo dev server
pnpm ios # Run on iOS
pnpm android # Run on Android
pnpm web # Run on web
# Code Quality
pnpm lint # Run ESLint
npx tsc --noEmit # Type check
# Project
pnpm reset-project # Reset to fresh projectThe app includes mock conversation data (lib/api/messages.ts) with:
- Initial 13-message conversation between "Jannis" and user
- Pagination support (20 messages per page)
- Simulated network delays (500-800ms)
- Auto-generated older messages for testing
- โ Native component for message rendering
- โ Optimistic updates for instant feedback
- โ Proper animation cleanup to prevent memory leaks
- โ Memoized components with React Compiler
- โ Efficient query cache management
- โ Self-sizing message bubbles
- โ NPC responses moved outside render cycle
- Real backend integration
- Image/media attachments
- Message timestamps
- Read receipts
- Group chat support
- Push notifications
- Voice messages
- Message reactions
- Search functionality
- Message editing/deletion
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
For questions or feedback, please open an issue on GitHub.
temporarystudios
- GitHub: @temporarystudios
Built with โค๏ธ using Expo and React Native
