Announcing: React Native Best Practices for AI Agents

Published

We’re turning the knowledge from The Ultimate Guide to React Native Optimization into react-native-best-practices: a set of structured, agent-oriented skills for AI coding agents.

Over the years we’ve worked on a lot of large React Native codebases. Different products, different teams, different constraints, but many of the same problems show up every time:

  • slow startup,
  • unnecessary re-renders,
  • list performance issues,
  • memory growing over time,
  • release builds behaving differently than debug builds.

The list goes on and on.

Since 2020 we’ve been sharing our expertise on these challenges in The Ultimate Guide to React Native Optimization (PDF/ePub/print). It’s free, and it’s written for humans.

Now that AI coding agents are writing more code—including Expo and React Native apps—it makes sense to publish these practices in a format that tools can discover and apply consistently.

How we’ve collected these practices

For each edition of the guide, we’ve worked with dozens of engineers from Callstack, Expo, and the community to distill the most common problems we see in real codebases into actionable solutions.

Because React Native performance is cross-platform by default, we group the skills into three categories that eventually map to two core metrics: FPS and TTI.

JavaScript

Techniques that focus on React and the React Native runtime. In practice, preventing unnecessary render work is often the biggest lever. We cover memoization and React Compiler, atomic state patterns, moving heavy work off the JS thread, and more.

Native

Sometimes JavaScript changes aren’t enough. This is where we share techniques for profiling and debugging iOS/Android runtime behavior, plus common pitfalls when building native modules for React Native.

Bundling

Runtime optimization is only part of the story. We also cover build-time work: reducing native assets, measuring and inspecting app size, trimming unnecessary JavaScript, and configuring Hermes for more efficient memory mapping.

What’s inside a skill

Each skill focuses on a specific topic and follows a consistent structure:

  • When to Use,
  • Prerequisites,
  • Steps,
  • Examples,
  • Pitfalls,
  • Related links

The content is based on how we’ve optimized real React Native apps, not on theoretical recommendations. At launch, the repository includes 27 skills across JavaScript, React, native iOS and Android, and bundling.

Example: R8 code shrinking on Android

A typical skill describes one concrete change, such as enabling R8 for Android release builds. We see this missed a lot—partly because it’s disabled by default in the standard React Native template.

Instead of just saying “turn on R8” and calling it a day, the skill goes a step further. It’s not only minifyEnabled. You typically also want shrinkResources configured correctly:

android {
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true  // Requires minifyEnabled
        }
    }
}

‍What often goes wrong is breakage caused by minification + reflection (or code generation) in certain libraries. The fix is usually adding keep rules for the affected packages/classes. The skill includes examples, like this one for Firebase:‍

-keep class io.invertase.firebase.** { *; }
-dontwarn io.invertase.firebase.**

And finally, the skill doesn’t treat this as a checkbox. It also shows how to verify whether the optimization actually helped, for example by building a release artifact:

cd android
./gradlew assembleRelease
# or
./gradlew bundleRelease

‍…and by cross-checking results with related skills like Analyze App Bundle Size, which walks through using Spotify’s Ruler.

How to use react-native-best-practices

These best practices are packaged as Agent skills that install into Opencode, Codex, Claude Code, Cursor, and other coding agents. When your agent reviews, optimizes, or develops a React Native or Expo codebase, it can reference these patterns and suggest fixes.‍

npx add-skill callstackincubator/agent-skills

or in Claude Code:

/plugin marketplace add callstackincubator/agent-skills
/plugin install react-native-best-practices@callstack-agent-skills

What’s next

Some areas of React Native optimization depend on visual tools like profilers, flame graphs, and memory timelines. These aren’t easy for agents to interpret yet. We’re exploring ways to connect those tools through MCP so that visual output can be analyzed alongside the written guidance.

For now, this project focuses on decisions, configurations, and good practices that can be described precisely and applied consistently.

Visit the callstackincubator/agent-skills repository.

Insights

Learn more about AI

When to Build a Custom AI Model? RAG vs. Fine-Tuning

Nov 27Article

When to Build a Custom AI Model? RAG vs. Fine-Tuning

Start with a base model. Add RAG when answers depend on current information, and test fine-tuning when a specific failure persists even with the right context. A React Native chatbot that picks up a policy update in SQLite and a support assistant that mishandles a customer’s change of request show when to use each approach or combine them.

How an AI-SDLC Audit Helps You Decide What to Automate First

Nov 26Article

How an AI-SDLC Audit Helps You Decide What to Automate First

An AI-SDLC audit will help your team decide where automation is worth the investment before you commit to a build. Follow a deployment lookup that starts with a testing ticket, from a specific problem statement to an agent design and a proposed pilot. See what the three audit deliverables give your team and how to evaluate the workflow afterward.

Building a Software Factory: AI Reviewers That Don’t Share the Writer’s Blind Spots

Nov 19Article

Building a Software Factory: AI Reviewers That Don’t Share the Writer’s Blind Spots

A reviewer produced 155 confirmed findings and five rounds of work. Szymon Chmal explains how that experience shaped Simlock’s review process, from specialist agents and verified findings to targeted rechecks and historical replays.

Nov 12Live Stream

Mobile Development, Plugins & AI-Powered Workflows

Join Kewin Wereszczyński and Hanno Gödecke on November 12 for live demos and a discussion of the Mobile Dev plugin and AI-powered mobile workflows.

Building the React Native Software Factory — cover

Nov 11Talk

Building the React Native Software Factory

Join us at React Foundation Meetup London on November 11 to explore how AI agents build and debug React Native apps, from one terminal to the cloud.

Build, Launch, and Maintain: The Business Case for a Software Factory

Nov 10Article

Build, Launch, and Maintain: The Business Case for a Software Factory

Explore an anonymized software factory business case, its delivery workflow, and the staffing assumptions behind a projected 65% reduction in total costs.

Harness Engineering: Context, Skills, and Reliable AI Workflows

Nov 10Podcast

From Prompts to Harnesses: Building Reliable AI Workflows

Amazon’s Anisha Malde joins Łukasz Chludziński to discuss harness engineering, agent skills, and how AI is changing cross-platform development.

Building a Software Factory: Write Specs an Agent Can Build From — cover

Nov 6Article

Building a Software Factory: Write Specs an Agent Can Build From

Learn how to research requirements, resolve open decisions, and write testable specs that AI coding agents can implement without the planning conversation.

 Large-Scale Migrations With Coding Agents: Planning, Verification, and Rollback — cover

Nov 4Article

Large-Scale Migrations With Coding Agents: Planning, Verification, and Rollback

Plan codebase migrations with coding agents using reviewable requirements, verification checks, staged rollouts, and defined rollback criteria.

cover

Oct 15Live Stream

Who Left the Agents Running? React Native Software Factories

Join Kewin Wereszczyński and Szymon Chmal to explore what can go wrong in a React Native software factory overnight and the controls that keep agents on track.

cover

Oct 14Podcast

When Coding Gets Faster, What Breaks Next?

Matt Hargett explains how AI moves bottlenecks across testing, deployment, infrastructure, support, and the rest of software delivery.

cover

Oct 12Podcast

AI Coding Agents and Hermes With Tzvetan Mikov

Tzvetan Mikov discusses AI coding agents, context switching, low-level engine optimization, reviewing specs and tests, and his plans for Hermes X.

cover

Mar 19Tutorial

The Hard Way vs. The React Native AI SDK Way: Stop Writing Custom Modules for Every Model

Learn how React Native AI uses a unified provider model to switch between cloud and on-device LLMs without rewriting application logic, enabling reliable AI experiences online and offline.

cover

Mar 12Tutorial

Build Smarter Apps: Tool Calling & AI Orchestration Explained

Learn how on-device models in React Native can call tools, interact with external APIs, and return structured outputs you can use directly in application logic.

cover

Mar 5Tutorial

MLC LLM + React Native: On-Device AI Without the Pain

Learn how to run third-party on-device LLMs in React Native using MLC LLM. Choose your models, run them efficiently across platforms, and keep a unified JavaScript API with React Native AI.

cover

Feb 24Tutorial

Intelligent Fallbacks with Apple Intelligence in React Native

Learn how to use Apple’s built-in Foundation Models in React Native apps, reduce memory usage, and enable fast, fully on-device AI with React Native AI Apple.

cover

Feb 10Tutorial

What Is the React Native AI SDK? A Complete Intro & Quickstart

Learn why on-device AI matters for React Native apps, how local LLMs behave offline, and what problems React Native AI is designed to solve from day one.

cover

Jan 29Tutorial

Implementing an Android TurboModule with Kotlin

Learn how to implement a React Native TurboModule on Android, from the TypeScript spec and Codegen to the Kotlin implementation and package registration.

cover

Jan 19Tutorial

Working with Different Threads in Swift TurboModules

Learn how JavaScript, native module, background, and main threads interact in React Native TurboModules, and how to use GCD queues to run async work safely in Swift.

cover

Jan 9Tutorial

How to Add Type-Safe Constants to Swift TurboModules

Learn how to expose typed, immutable constants from a Swift TurboModule using Codegen, and get full end-to-end type safety between native and JavaScript.

cover

Dec 30Tutorial

Adding Event Emitters to Your TurboModule in Swift

Learn how to emit native events from a Swift TurboModule and subscribe to them in JavaScript, including proper memory management and Codegen integration.

Writing a Swift TurboModule in React Native

Dec 22Tutorial

Writing Your First TurboModule in Swift

Learn how to build a fully working TurboModule in Swift, integrate it with Codegen, and bridge it through Objective‑C inside an Expo app.