<?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: Nadia Guarracino</title>
    <description>The latest articles on DEV Community by Nadia Guarracino (@engynn).</description>
    <link>https://dev.to/engynn</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%2F1180448%2Fabd140a4-216e-4868-b51b-eac9a86f954e.png</url>
      <title>DEV Community: Nadia Guarracino</title>
      <link>https://dev.to/engynn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/engynn"/>
    <language>en</language>
    <item>
      <title>Using TanStack Query’s focusManager in React Native Without Over-Refetching</title>
      <dc:creator>Nadia Guarracino</dc:creator>
      <pubDate>Fri, 16 Oct 2026 10:51:52 +0000</pubDate>
      <link>https://dev.to/engynn/using-tanstack-querys-focusmanager-in-react-native-without-over-refetching-2mb3</link>
      <guid>https://dev.to/engynn/using-tanstack-querys-focusmanager-in-react-native-without-over-refetching-2mb3</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvppjqnzcn6o8cziafbe3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvppjqnzcn6o8cziafbe3.PNG" alt=" " width="800" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Earlier this year, I started building &lt;strong&gt;Gallry&lt;/strong&gt;, an app for independent artists and for people who want a better way to discover them. &lt;/p&gt;

&lt;p&gt;After finally reaching the point where I could say “this is enough for an MVP” (which turned out to be a surprisingly difficult line to draw, not gonna lie), I’m now preparing it for a closed beta, and before adding more features, I’ve been doing some cleanup and hardening. &lt;/p&gt;

&lt;p&gt;One small problem that came up was remote feature flags: &lt;strong&gt;I wanted Gallry to pick up flag changes when the app returns from the background, without requiring a restart&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;On the web, TanStack Query can react to window focus. &lt;strong&gt;In React Native, there is no browser window to observe&lt;/strong&gt;, so you need to connect React Native’s AppState to React Query’s focusManager, but the more interesting question was: &lt;strong&gt;should returning to the foreground always trigger a database call?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine this very normal mobile user flow:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Gallry → WhatsApp → Gallry → Telegram → Gallry.&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Those are multiple foreground events in a few minutes. Technically, I can refetch the feature flags every time, but that doesn’t mean I should. &lt;/p&gt;

&lt;p&gt;For now, Gallry uses &lt;strong&gt;AppState + focusManager&lt;/strong&gt;, while **staleTime **determines whether the query is actually stale enough to refetch. I’m also deliberately not using realtime subscriptions for feature flags yet.&lt;/p&gt;

&lt;p&gt;What I liked about this problem is that staleTime stopped feeling like just a React Query performance setting and became a product and &lt;strong&gt;architecture decision&lt;/strong&gt;: "How stale am I willing to let this feature flag become?"&lt;/p&gt;

&lt;p&gt;For a kill switch, the answer might be “almost not at all”, but for a small UI flag, a few minutes may be perfectly fine.&lt;/p&gt;

</description>
      <category>mobile</category>
      <category>reactnative</category>
      <category>performance</category>
      <category>startup</category>
    </item>
  </channel>
</rss>
