home / skills / yuniorglez / gemini-elite-core / react-native-pro

react-native-pro skill

/skills/react-native-pro

This skill helps you master high-performance React Native apps using Fabric, React 19 hooks, and native integrations for 120fps mobile UX.

npx playbooks add skill yuniorglez/gemini-elite-core --skill react-native-pro

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
4.3 KB
---
name: react-native-pro
id: react-native-pro
version: 1.1.0
description: "Master of React Native (0.78+), specialized in the New Architecture (Fabric), React 19 Hooks, and High-Performance Mobile UX."
last_updated: "2026-01-22"
---

# Skill: React Native Pro (Standard 2026)

**Role:** The React Native Pro is a specialized mobile engineer dedicated to building "Native-Feeling" cross-platform applications. In 2026, React Native 0.78 has fully matured the New Architecture, offering synchronous layouts (Fabric), direct JSI communication, and deep integration with React 19's `use` and `Actions`.

## 🎯 Primary Objectives
1.  **Architecture Mastery:** Leveraging Fabric and TurboModules for high-fidelity rendering and native interop.
2.  **React 19 Hooks:** Utilizing `useActionState`, `useOptimistic`, and `use` to simplify complex data and UI flows.
3.  **Performance Engineering:** Mastering Reanimated 4, Skia, and the React Compiler for 120fps interfaces.
4.  **Native Integration:** Writing custom JSI modules in Rust or C++ for high-performance logic.

---

## 🏗️ The 2026 Mobile Toolbelt

### 1. Core Framework
- **React Native 0.78+:** Requiring the New Architecture by default.
- **React 19:** Native support for Actions and concurrent rendering.
- **Hermes Engine:** Optimized for fast TTI and low memory footprint.

### 2. High-Performance Libraries
- **Reanimated 4:** Worklet-based animations with zero main-thread blocking.
- **Shopify Skia:** For complex 2D graphics and shaders.
- **React Navigation 7+:** Fully typed, performance-optimized routing.

---

## 🛠️ Implementation Patterns

### 1. React 19 Actions in Mobile
Handling data submission with native pending states.

```tsx
import { useActionState } from 'react';

function ProfileForm({ updateProfile }) {
  const [state, action, isPending] = useActionState(updateProfile, null);

  return (
    <View>
      <TextInput name="username" editable={!isPending} />
      <Button onPress={action} title="Save" disabled={isPending} />
      {isPending && <ActivityIndicator />}
    </View>
  );
}
```

### 2. Optimized List Rendering (FlashList)
In 2026, `FlatList` is legacy. We use `FlashList` for near-native list performance.

```tsx
import { FlashList } from "@shopify/flash-list";

<FlashList
  data={items}
  renderItem={({ item }) => <Card item={item} />}
  estimatedItemSize={200}
/>
```

### 3. Native Drawables (Android XML)
Directly using Android Vector Drawables for crisp, high-DPI assets.

---

## 🚫 The "Do Not List" (Anti-Patterns)
1.  **NEVER** use the "Bridge" for high-frequency data (e.g., scroll events). Use **JSI** or **TurboModules**.
2.  **NEVER** perform heavy calculations on the JS main thread. Move to a **Worklet** or **Web Worker**.
3.  **NEVER** use `forwardRef`. Use React 19's direct `ref` as props.
4.  **NEVER** ignore "Cumulative Layout Shift" in mobile. Use `estimatedItemSize` for lists.

---

## 🛠️ Troubleshooting & Debugging

| Issue | Likely Cause | 2026 Corrective Action |
| :--- | :--- | :--- |
| **Dropped Frames (FPS)** | Expensive JS execution during animation | Move animation logic to `useAnimatedStyle` (Reanimated 4). |
| **Memory Leaks** | Uncleaned event listeners in Native Modules | Use `EventEmitter.remove()` and audit TurboModule lifecycle. |
| **Slow Startup (TTI)** | Large bundle size / many dependencies | Use `Lazy` loading for screens and audit `node_modules`. |
| **Layout Mismatch** | Flexbox differences between iOS/Android | Use the `inspector` and prefer `gap` over complex margins. |

---

## 📚 Reference Library
- **[New Architecture](./references/1-new-architecture.md):** Fabric & TurboModules deep dive.
- **[Performance & Reanimated 4](./references/2-performance-and-reanimated.md):** High-speed UX.
- **[Cross-Platform UX](./references/3-cross-platform-ux.md):** Designing for iOS and Android.

---

## 📊 Quality Metrics
- **Frame Rate:** Constant 60/120 fps for all transitions.
- **App Size:** < 15MB for base Squaads mobile apps.
- **TTI (Time to Interactive):** < 1.5s on mid-range devices.

---

## 🔄 Evolution from 0.70 to 0.78
- **0.72:** New Architecture improvements, stable Symlinks.
- **0.74:** Yoga 3.0, Bridgeless by default (internal).
- **0.76:** Fabric and TurboModules enabled by default.
- **0.78:** React 19 integration, Android XML Drawables.

---

**End of React Native Pro Standard (v1.1.0)**

Overview

This skill is a specialist React Native engineer for projects using React Native 0.78+ and the New Architecture (Fabric). It focuses on delivering native-feeling cross-platform apps by combining React 19 hooks, JSI/TurboModules, and high-performance libraries like Reanimated 4 and Skia. The goal is predictable 60–120fps UX, low TTI, and minimal binary size.

How this skill works

The skill inspects app architecture and runtime hotspots, recommending Fabric/TurboModule adoption, JSI-native bindings, and React 19 Action patterns to reduce main-thread work. It analyzes list rendering, animation pipelines, and bundle composition, then prescribes concrete migrations (e.g., FlashList, worklets, lazy screens) and native module implementations in Rust/C++ where appropriate. It also provides runbooks for debugging frame drops, memory leaks, and startup delays.

When to use it

  • Building new apps that must feel native on iOS and Android with React Native 0.78+.
  • Migrating legacy RN apps off the Bridge to Fabric, TurboModules, and JSI.
  • Optimizing animation-heavy screens, lists, or custom native integrations.
  • Reducing TTI and overall bundle size for mid-range device targets.
  • Implementing high-frequency native logic (audio, physics, sensors) requiring JSI.

Best practices

  • Prefer Fabric components and TurboModules for native interop instead of the Bridge.
  • Move animation and high-frequency work to Reanimated 4 worklets or native JSI modules.
  • Use React 19 Actions (useActionState, useOptimistic, use) for form submission and optimistic flows.
  • Replace FlatList with FlashList and set estimatedItemSize to avoid layout shifts.
  • Lazy-load screens and audit node_modules to keep base app size under targets.

Example use cases

  • Implementing a 120fps gesture-driven animation using Reanimated 4 and JSI hooks.
  • Migrating a chat or feed from the Bridge to TurboModules and FlashList for smooth scrolling.
  • Writing a native audio DSP module in Rust exposed via JSI to avoid JS stalls.
  • Optimizing app startup: split bundles, lazy screens, and shrink Hermes bytecode.
  • Resolving intermittent layout mismatches by switching to gap-based spacing and inspector checks.

FAQ

Do I still need the Bridge for native features?

No—avoid the Bridge for high-frequency data. Use Fabric, TurboModules, or JSI for performance-sensitive paths.

When should I write a JSI module in Rust or C++?

When logic must run off the JS thread at native speed (audio, physics, heavy math, or tight animation loops).