Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, May 16, 2026. Learn more…

Leanpub Header

Skip to main content

React Native Internals

Understand React Native internals with zero guesswork.

Minimum price

$19.00

$29.00

You pay

$29.00

Author earns

$23.20
$
You can also buy this book with 1 book credit. Get book credits with a Reader Membership or an Organization Membership for your team.
PDF
EPUB
WEB
About

About

About the Book

This book is a systems-level exploration of React Native internals for engineers who want to understand and modify the framework itself. It develops a precise mental model from React Fiber and the scheduler through JSI and Fabric to platform runloops and threading behavior. Each chapter focuses on invariants so you can reason about correctness under concurrency, identify race conditions, and make safe changes to core systems. With real pull request case studies, testing strategies, and cross-language call stack tracing, it prepares you to read, debug, and contribute to the React Native codebase with confidence.

Share this book

Categories

Author

About the Author

Abdur-Rahmaan Janhangeer

Long-time Python and Open Source specialist.

Contents

Table of Contents

Chapter 0: How to Use This Book

  1. 0.1: Theory, Lab, and Production Pitfall - Structure Guide
  2. 0.2: Setting Up a Local RN Core Source Build
  3. 0.3: Navigating the RN Repository - Function‑Level Reading Order
  4. 0.4: Platform Prerequisites

Chapter 1: Fiber Architecture – The Foundation

  1. 1.1 Why React Needed a Rewrite
  2. 1.2 Fiber Node Structure
  3. 1.3 Reconciliation Heuristics and Child Diffing
  4. 1.4 Effect Flag Propagation and Commit Traversal
  5. 1.5 Bailout Rules and Subtree Skipping
  6. 1.6 Update Queues and State Model Internals (Overview)

Chapter 2: Scheduler and Lanes - Corrected Mental Model

  1. 2.1: The Scheduler - Task Queue for Interruptible Work
  2. 2.2: Priority Expiration and Starvation Handling
  3. 2.3: Lanes - React Reconciler’s Priority System
  4. Connection and Preview

Chapter 3: Suspense, Concurrent Features, and RN

  1. 3.1: Suspense on the Server vs. Native Client
  2. 3.2: Concurrent Rendering in React Native – Current Support
  3. 3.3: useTransition and useDeferredValue – Mounting Implications
  4. 3.4: Suspense Fallback and Fabric Shadow Tree Consistency

Chapter 4: Formal System Boundary Model - Ownership Invariants

  1. 4.1: React Owns
  2. 4.2: React Native Owns
  3. 4.3: Platform Owns
  4. 4.4: Ownership Boundaries - Explicit Contracts
  5. What Breaks When Boundaries Blur
  6. How to Read Code with Boundaries in Mind
  7. Summary of Invariants
  8. Connection to Previous and Next

Chapter 5: React Update Queues and State Model Internals – Deep Dive

  1. 5.1: Update Queue Architecture – updateQueue and shared.pending
  2. 5.2: Hook State Management – lastRenderedReducer and Dispatcher
  3. 5.3: Batching and Lane Prioritization Inside the Queue
  4. 5.4: Forced Updates vs. Bailouts – When State Changes but Rendering Skips
  5. 5.5: Cross‑Component State Propagation – Context and Refs

Chapter 6: Legacy Bridge → JSI → Why the Bridge Failed

  1. 6.1 Legacy Bridge (Deprecated)
  2. 6.2 JSI – Synchronous, Type-Safe Runtime Embedding
  3. 6.3 Migration Constraints Inside Meta
  4. 6.4 The Diff‑Driven Mental Model
  5. 6.5 Writing Safe Code in RN’s C++ & JSI Environment

Chapter 7: Fabric – New Mounting System (Deep Enough to Modify)

  1. 7.1 Shadow Tree – Immutability and Revision Model
  2. 7.2 ShadowNode Cloning Semantics
  3. 7.3 Mounting Layer Diffing and Props/State Separation
  4. 7.4 Partial Tree Commits and Consistency Guarantees
  5. Chapter Flow Summary

Chapter 8: Scheduler Implementation Details – Black Box Opened

  1. 8.1: RuntimeScheduler – The Distributed Scheduler Problem
  2. 8.2: Task Queue Internals – The Priority Queue
  3. 8.3: Priority System – From React Priority to Execution Order
  4. 8.4: Yielding and Preemption – How High Priority Work Interrupts
  5. 8.5: Starvation Prevention – The Expiration Time Guarantee
  6. 8.6: Platform Runloop Integration – The Wakeup Source
  7. 8.7: Immediate vs Sync vs Async – Three Scheduling Modes
  8. 8.8: Microtasks – The Missing Feature
  9. 8.9: Common Failure Modes – What Breaks in Production
  10. 8.10: Observing the Scheduler – Tools and Incantations
  11. 8.11: Changing the Scheduler – What You Can Modify

Chapter 9: Events, Priorities, and Responder System

  1. 9.1 Event Pipeline Overview
  2. 9.2 Discrete vs. Continuous Events
  3. 9.3 Event Priority vs. Render Priority Interaction
  4. 9.4 Responder System Internals
  5. 9.5 Event Loop Integration
  6. 9.6 Testing Event Behavior
  7. 9.7 Common Failure Patterns
  8. 9.8 Next Chapter

Chapter 10: Concurrency Hazards and Race Conditions

  1. 10.1 Shared Mutable State – When Shadows and Props Collide
  2. 10.2 React Concurrent Features + Fabric – Known Races
  3. 10.3 Threading Model – Background Work and Commit Consistency
  4. 10.4 Data Races in JSI Host Objects – Prevention Patterns
  5. Connecting to Chapter 9
  6. Next Chapter: Code Reading Guides

Chapter 11: Code Reading Guides – Function‑Level Navigation

  1. 11.5: Navigation Training – Where Code Lives & How to Trace Cross‑Language Flow

Chapter 12: Event Loop Coordination – Runloops and Schedulers

  1. 12.1: Runloop Primer – iOS CFRunLoop and Android Looper
  2. 12.2: JS Message Queue vs Native Dispatch Queue
  3. 12.3: JSI Callback Scheduling from Background Threads
  4. 12.4: Runloop Integration Deep Dive

Chapter 13: Testing Strategies for Core Contributors – Beyond It Works on My Machine

  1. 13.1 The Testing Pyramid for RN Core
  2. 13.2 How to Write a Minimal Failing Case Inside the RN Repository
  3. 13.3 Fabric Specific Validation – How to Test the Shadow Tree
  4. 13.4 Behavioural vs Snapshot Testing – When to Use Which
  5. 13.5 CI and Pre commit Hooks
  6. 13.6 Safety Checklist for Testing
  7. Connection and Preview

Chapter 14: Pull Request Case Studies – Real Contributor Examples

  1. 14.1 Small but Impactful – JSI Typing Fixes
  2. 14.2 Fabric Performance Regression – Bisect and Patch
  3. 14.3 Event Priority Mismatch – From Issue to Merge
  4. 14.4 Writing a New TurboModule – Step‑by‑Step PR Walkthrough
  5. 14.5 What These PRs Teach Us

Chapter 15: What Is NOT Guaranteed – And How to Survive

  1. 15.1 Unstable Public APIs – Documentation vs. Reality
  2. 15.2 Threading Assumptions That Change Between Releases
  3. 15.3 Layout and Measurement – Invariants You Cannot Rely On
  4. 15.4 When to Fork RN – Warning Signs and Escape Hatches
  5. 15.5 Detecting Regression Early – Telemetry for Invariants
  6. Summary for Chapter 15

Chapter 16: How to Write and Submit a Patch (RN Core)

  1. 16.1 Setup a Development Environment – Building RN from Source
  2. 16.2 Choosing the Right Branch – main vs. Stable Backport
  3. 16.3 Commit Message Conventions and Changelog Requirements
  4. 16.4 Testing Your Change Locally – RNTester and Fabric Tester
  5. 16.5 Running CI Locally with git Tricks
  6. 16.6 Responding to Code Review – Meta’s Expectations
  7. 16.7 PR Case Study – Small Change That Landed
  8. 16.8 What Happens After Merge
  9. Summary for Chapter 16

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub