<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Inayat Ali</title>
    <description>The latest articles on DEV Community by Inayat Ali (@inayat_ali).</description>
    <link>https://dev.to/inayat_ali</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4230732%2F1389d029-2178-41ed-a1b0-895ebb01426d.png</url>
      <title>DEV Community: Inayat Ali</title>
      <link>https://dev.to/inayat_ali</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/inayat_ali"/>
    <language>en</language>
    <item>
      <title>Architecting Offline-First Mobile Apps with SQLite, WatermelonDB &amp; Supabase</title>
      <dc:creator>Inayat Ali</dc:creator>
      <pubDate>Sun, 08 Nov 2026 15:38:27 +0000</pubDate>
      <link>https://dev.to/inayat_ali/architecting-offline-first-mobile-apps-with-sqlite-watermelondb-supabase-2fe8</link>
      <guid>https://dev.to/inayat_ali/architecting-offline-first-mobile-apps-with-sqlite-watermelondb-supabase-2fe8</guid>
      <description>&lt;h1&gt;
  
  
  Architecting Offline-First Mobile Apps with SQLite, WatermelonDB &amp;amp; Supabase
&lt;/h1&gt;

&lt;p&gt;When an EV driver enters an underground concrete garage, or a delivery driver hits a low-signal highway corridor, a "spinner-driven" cloud app completely fails.&lt;/p&gt;

&lt;p&gt;If your app shows an infinite loading spinner the moment 4G drops to 1 bar, it's not a resilient production product.&lt;/p&gt;

&lt;p&gt;Here is the exact architecture pattern I use to build zero-data-loss, offline-first mobile apps.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Core Principle: Local Database as Single Source of Truth
&lt;/h2&gt;

&lt;p&gt;In traditional apps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UI Component --&amp;gt; Network Request --&amp;gt; Cloud Database --&amp;gt; UI Updates
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the network stalls, the user is locked out.&lt;/p&gt;

&lt;p&gt;In true offline-first apps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UI Component &amp;lt;--&amp;gt; Local SQLite / WatermelonDB (0ms Instant Reads &amp;amp; Writes)
                      |
                      v (Background Sync Engine)
               Supabase / PostgreSQL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The user &lt;strong&gt;never&lt;/strong&gt; waits for network round-trips. Every tap, order, or check-in writes immediately to the local encrypted SQLite database and updates the UI in under 10ms.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The Idempotent Outbox Pattern (Zero Duplicate Orders)
&lt;/h2&gt;

&lt;p&gt;The hardest part of offline sync is not storing data locally — it's replaying mutations safely when connectivity returns.&lt;/p&gt;

&lt;p&gt;If a driver logs a delivery while offline, and the network retries 3 times on flaky 3G, how do you prevent creating 3 duplicate delivery records in your backend?&lt;/p&gt;

&lt;h3&gt;
  
  
  The Pattern: Client-Generated UUID Idempotency Keys
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;OutboxMutation&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;idempotencyKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// UUID v4 generated locally on device&lt;/span&gt;
  &lt;span class="nl"&gt;entity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;order_status&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ticket_scan&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ble_session&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Record&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;unknown&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;recordedAtIso&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;retryCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When network connectivity resumes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The background sync worker reads pending outbox rows in chronological order.&lt;/li&gt;
&lt;li&gt;It sends requests with the &lt;code&gt;idempotencyKey&lt;/code&gt; in the request header or payload.&lt;/li&gt;
&lt;li&gt;Supabase / PostgreSQL uses &lt;code&gt;ON CONFLICT (idempotency_key) DO UPDATE&lt;/code&gt; — ensuring 10 retries result in exactly &lt;strong&gt;one&lt;/strong&gt; recorded transaction.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  3. Storage Engine Comparison for Mobile
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Storage Engine&lt;/th&gt;
&lt;th&gt;Architecture&lt;/th&gt;
&lt;th&gt;Query Speed (10k items)&lt;/th&gt;
&lt;th&gt;Best Use Case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AsyncStorage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Key-Value string dump&lt;/td&gt;
&lt;td&gt;Poor (&amp;gt; 400ms scan)&lt;/td&gt;
&lt;td&gt;Simple auth tokens, user theme&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MMKV&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Memory-mapped key-value (JSI)&lt;/td&gt;
&lt;td&gt;Instant (&amp;lt; 1ms)&lt;/td&gt;
&lt;td&gt;Fast session state, flags&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;expo-sqlite&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Embedded relational SQL&lt;/td&gt;
&lt;td&gt;Fast (&amp;lt; 15ms)&lt;/td&gt;
&lt;td&gt;Relational records, local filtering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;WatermelonDB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Observable lazy SQLite engine&lt;/td&gt;
&lt;td&gt;Instant (&amp;lt; 5ms)&lt;/td&gt;
&lt;td&gt;Large feeds, complex multi-table offline apps&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  4. Pairing Offline Storage with Bluetooth BLE &amp;amp; Hardware
&lt;/h2&gt;

&lt;p&gt;In IoT and hardware companion apps (such as EV charging stations or medical peripherals):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The phone pairs directly with the peripheral over &lt;strong&gt;Bluetooth Low Energy (BLE) GATT characteristics&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Telemetry and billing logs are written directly to local SQLite while 100% offline.&lt;/li&gt;
&lt;li&gt;Once the user returns to Wi-Fi or cellular range, the delta synchronizer commits the verified session to Supabase without requiring user intervention.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Building an enterprise field service, fleet, or offline Bluetooth mobile application? I document production offline patterns at &lt;a href="https://innunext.com" rel="noopener noreferrer"&gt;innunext.com&lt;/a&gt; and design resilient &lt;a href="https://innunext.com/guides/offline-first-mobile-architecture-sqlite-supabase" rel="noopener noreferrer"&gt;offline-first mobile architectures&lt;/a&gt;.&lt;/p&gt;




</description>
      <category>reactnative</category>
      <category>mobile</category>
      <category>architecture</category>
      <category>database</category>
    </item>
    <item>
      <title>How to Prevent Apple App Store &amp; Google Play Rejections (The 2025/2026 Checklist)</title>
      <dc:creator>Inayat Ali</dc:creator>
      <pubDate>Sun, 08 Nov 2026 00:55:03 +0000</pubDate>
      <link>https://dev.to/inayat_ali/how-to-prevent-apple-app-store-google-play-rejections-the-20252026-checklist-59e8</link>
      <guid>https://dev.to/inayat_ali/how-to-prevent-apple-app-store-google-play-rejections-the-20252026-checklist-59e8</guid>
      <description>&lt;h1&gt;
  
  
  How to Prevent Apple App Store &amp;amp; Google Play Rejections (The 2025/2026 Checklist)
&lt;/h1&gt;

&lt;p&gt;Most mobile launch delays aren't caused by broken code. They're caused by failing strict platform compliance rules that automated bots and human reviewers test in the first 5 minutes.&lt;/p&gt;

&lt;p&gt;Here is the exact checklist I use to ship production React Native apps to the App Store and Google Play on the first attempt.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Apple Guideline 5.1.1(v) — Missing In-App Account Deletion
&lt;/h2&gt;

&lt;p&gt;If your app lets users create an account, you &lt;strong&gt;must&lt;/strong&gt; allow them to permanently initiate account deletion directly within the app.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ &lt;strong&gt;Rejection:&lt;/strong&gt; Directing users to a web link (&lt;code&gt;"Contact support to delete"&lt;/code&gt;) or an email address.&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Approval:&lt;/strong&gt; A visible &lt;code&gt;Delete Account&lt;/code&gt; button inside &lt;code&gt;Profile -&amp;gt; Settings&lt;/code&gt; with a confirmation modal and an automated server-side token revocation job.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Apple Guideline 3.1.1 — In-App Purchases vs. Stripe
&lt;/h2&gt;

&lt;p&gt;The rule is straightforward:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What you're selling&lt;/th&gt;
&lt;th&gt;Allowed payment gateway&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Digital Goods&lt;/strong&gt; (AI tokens, SaaS unlock, extra lives, in-app badges)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Apple StoreKit / Google Play Billing&lt;/strong&gt; (RevenueCat)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Real-World Goods &amp;amp; Services&lt;/strong&gt; (Rides, physical merch, event tickets, food delivery)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Stripe / PayPal / Card&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you try to unlock an AI chat feature or premium mobile tier using Stripe, Apple will reject the binary immediately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Always include on the paywall:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A visible &lt;code&gt;Restore Purchases&lt;/code&gt; button.&lt;/li&gt;
&lt;li&gt;Clear subscription duration and pricing terms.&lt;/li&gt;
&lt;li&gt;Direct links to your &lt;code&gt;Privacy Policy&lt;/code&gt; and &lt;code&gt;Terms of Use&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. iOS Privacy Manifests (&lt;code&gt;PrivacyInfo.xcprivacy&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Apple now enforces Privacy Manifests for all apps and third-party SDKs using &lt;strong&gt;Required Reason APIs&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File timestamp access&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;UserDefaults&lt;/code&gt; / System boot time&lt;/li&gt;
&lt;li&gt;Disk space queries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Verify that every native package in your app declares its required reasons. If you use Expo EAS, modern SDKs (51+) generate this automatically, but any custom native module must have an explicit &lt;code&gt;.xcprivacy&lt;/code&gt; declaration.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Google Play: Background Location &amp;amp; Foreground Services
&lt;/h2&gt;

&lt;p&gt;Android 14+ will immediately reject your release if you request &lt;code&gt;ACCESS_BACKGROUND_LOCATION&lt;/code&gt; or use generic foreground services without justification.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ &lt;strong&gt;Rejection:&lt;/strong&gt; Vague permission prompt like &lt;code&gt;"App needs location to work."&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Approval:&lt;/strong&gt; Prominent user-facing disclosure dialog &lt;em&gt;before&lt;/em&gt; the OS prompt appears, clearly explaining the user benefit:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nl"&gt;"NSLocationWhenInUseUsageDescription"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Used to calculate live turn-by-turn route dispatch and locate nearby transit stops."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pro Tip:&lt;/strong&gt; Google Play Console requires a 30-second in-app video recording showing how the background feature is triggered by the user.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. App Store Reviewer Sandbox Credentials (Guideline 2.1)
&lt;/h2&gt;

&lt;p&gt;Never give Apple reviewers an empty state or broken onboarding flow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a dedicated demo account with pre-populated dummy data (orders, messages, profile).&lt;/li&gt;
&lt;li&gt;Provide username + password directly in the &lt;strong&gt;App Review Information&lt;/strong&gt; notes field.&lt;/li&gt;
&lt;li&gt;If your app requires SMS OTP verification, configure a static test phone number (&lt;code&gt;+1 555-0199&lt;/code&gt;) with a fixed OTP (&lt;code&gt;123456&lt;/code&gt;) in your backend for the reviewer.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Summary Cheat Sheet
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requirement&lt;/th&gt;
&lt;th&gt;Apple Guideline&lt;/th&gt;
&lt;th&gt;Google Play Equivalent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;In-app account deletion&lt;/td&gt;
&lt;td&gt;5.1.1(v)&lt;/td&gt;
&lt;td&gt;Data Safety Policy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;In-App Purchases for digital unlocks&lt;/td&gt;
&lt;td&gt;3.1.1&lt;/td&gt;
&lt;td&gt;Play Billing Policy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Required Reason API manifest&lt;/td&gt;
&lt;td&gt;Privacy Manifest&lt;/td&gt;
&lt;td&gt;Data Safety Declarations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Clear permission justification&lt;/td&gt;
&lt;td&gt;Human Interface Guidelines&lt;/td&gt;
&lt;td&gt;Target API 34+ Foreground Types&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reviewer demo login with test data&lt;/td&gt;
&lt;td&gt;2.1 App Completeness&lt;/td&gt;
&lt;td&gt;App Access Instructions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;p&gt;Need help getting an enterprise build approved or resolving an active rejection notice? I document production architecture and submission playbooks at &lt;a href="https://innunext.com" rel="noopener noreferrer"&gt;innunext.com&lt;/a&gt; and conduct direct &lt;a href="https://innunext.com/guides/apple-app-store-google-play-rejection-checklist" rel="noopener noreferrer"&gt;App Store &amp;amp; Google Play compliance reviews&lt;/a&gt;.&lt;/p&gt;




</description>
      <category>reactnative</category>
      <category>ios</category>
      <category>android</category>
      <category>appstore</category>
    </item>
    <item>
      <title>How to Fix React Native Lag, Memory Leaks &amp; Hit 60 FPS in Production</title>
      <dc:creator>Inayat Ali</dc:creator>
      <pubDate>Fri, 06 Nov 2026 16:14:40 +0000</pubDate>
      <link>https://dev.to/inayat_ali/how-to-fix-react-native-lag-memory-leaks-hit-60-fps-in-production-1l19</link>
      <guid>https://dev.to/inayat_ali/how-to-fix-react-native-lag-memory-leaks-hit-60-fps-in-production-1l19</guid>
      <description>&lt;h1&gt;
  
  
  How to Fix React Native Lag, Memory Leaks &amp;amp; Hit 60 FPS in Production
&lt;/h1&gt;

&lt;p&gt;After auditing 12+ production React Native codebases, 80% of "the app feels slow" complaints trace back to the same 3 root causes.&lt;/p&gt;

&lt;p&gt;Here's the exact fix for each.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Stop Re-Rendering Everything on Every State Tick
&lt;/h2&gt;

&lt;p&gt;The most common frame drop: anonymous inline callbacks creating new function references on every parent render.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ❌ New function on every render → child re-renders every time&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;List&lt;/span&gt; &lt;span class="nx"&gt;onPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;navigate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Detail&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;})}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="c1"&gt;// ✅ Stable reference → no unnecessary re-renders&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handlePress&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useCallback&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;navigate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Detail&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;List&lt;/span&gt; &lt;span class="nx"&gt;onPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handlePress&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also swap &lt;code&gt;AsyncStorage&lt;/code&gt; for &lt;strong&gt;MMKV&lt;/strong&gt; on mount reads — it's C++ JSI, synchronous, and 10x faster for cold-start hydration.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Memory Leaks — The Silent Killer
&lt;/h2&gt;

&lt;p&gt;Apps using WebSockets, Supabase listeners, background GPS, or BLE leak memory every time a screen unmounts without cleaning up native subscriptions. Over 20 minutes: Android kills the process, iOS jetsams it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;controller&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;AbortController&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;unsubscribe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;channel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aborted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abort&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;unsubscribe&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// No zombie listeners, no RAM retention&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;channelId&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Every &lt;code&gt;useEffect&lt;/code&gt; that opens a subscription, timer, or native listener must return a cleanup function. No exceptions.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. FlatList → FlashList + Fix Your Images
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;FlatList&lt;/code&gt; doesn't recycle views during fast scrolling → blank cells → perceived lag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Drop-in replacement, same API&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;FlashList&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@shopify/flash-list&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;FlashList&lt;/span&gt;
  &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;renderItem&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;renderItem&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;estimatedItemSize&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;72&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="c1"&gt;// Measure your actual item height&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And never decode a 4000×3000px upload inside an 80×80px avatar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ✅ Request the right size from your CDN&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;thumb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;avatarUrl&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;?w=160&amp;amp;h=160&amp;amp;fit=crop`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;expo-image&lt;/code&gt; over the built-in &lt;code&gt;Image&lt;/code&gt; for hardware-decoded caching.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Move Animations to the UI Thread
&lt;/h2&gt;

&lt;p&gt;Any &lt;code&gt;Animated.Value&lt;/code&gt; on the JS thread drops frames the moment a network call or navigation fires.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ❌ JS thread — stutters during API calls&lt;/span&gt;
&lt;span class="nx"&gt;Animated&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;toValue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;useNativeDriver&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// ✅ Reanimated worklet — C++ UI thread, frame-perfect&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;opacity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSharedValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useAnimatedStyle&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;withTiming&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Diagnostic Order
&lt;/h2&gt;

&lt;p&gt;Profile on a &lt;strong&gt;real mid-range Android device in release mode&lt;/strong&gt; — never Metro dev mode (timings are 3–5x slower).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. React DevTools Profiler → find heaviest re-render tree
2. Audit all useEffects for missing cleanup
3. FlatList → FlashList on any list &amp;gt; 50 items
4. CDN-resize images to display size
5. Migrate animations to Reanimated worklets
6. Enable New Architecture in app.json (Expo SDK 51+)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Performance bugs in React Native are diagnosable, not mysterious. These 4 patterns cover 90% of real-world production cases.&lt;/p&gt;

&lt;p&gt;If your existing app is lagging or crashing on Android, I write about more patterns like this at &lt;a href="https://innunext.com" rel="noopener noreferrer"&gt;innunext.com&lt;/a&gt; and do deep-dive &lt;a href="https://innunext.com/guides/fix-react-native-memory-leaks-60fps" rel="noopener noreferrer"&gt;production audits&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Tags: &lt;code&gt;reactnative&lt;/code&gt; &lt;code&gt;javascript&lt;/code&gt; &lt;code&gt;mobile&lt;/code&gt; &lt;code&gt;performance&lt;/code&gt; &lt;code&gt;typescript&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>javascript</category>
      <category>mobile</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
