AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

State And Data

skill-neha-rn-developer-skills-state-and-data · by Neha

Review React Native data and state handling — server state with a query library, caching and staleness, offline behaviour, network transitions, transactions, and loading/empty/error states. Use when wiring up APIs, handling offline, or reviewing data flow.

No reviews yet
0 installs
31 views
0.0% view→install

Install

$ agentstack add skill-neha-rn-developer-skills-state-and-data

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-neha-rn-developer-skills-state-and-data)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of State And Data? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

State and Data Skill

Applicability

  • Platforms: iOS and Android
  • React Native: 0.76+ (New Architecture interop assumed unless a checklist item says otherwise)

When to Use

  • Wiring a screen up to an API
  • Reviewing how server state is fetched, cached, and displayed
  • Handling offline mode, network transitions, or flaky connections
  • Implementing payments, checkout, or other critical transactions

Guidance

Server State

  • [ ] Server state uses a query library (e.g. TanStack Query), not local useState for API data
  • [ ] No server state duplicated into local state
  • [ ] Appropriate staleTime set per data type (not the default 0 for everything)
  • [ ] Mutations use optimistic updates (onMutate) where appropriate, with rollback on error
  • [ ] Loading states shown (skeleton or spinner)
  • [ ] Empty states handled (no blank screens)
  • [ ] Error states handled, not just the happy path

Incorrect:

const [users, setUsers] = useState([]);
useEffect(() => {
  fetch('/api/users').then(r => r.json()).then(setUsers);
}, []);

Correct:

const { data: users } = useQuery({
  queryKey: ['users'],
  queryFn: () => api.getUsers(),
  staleTime: 5 * 60 * 1000,
});

Form & Local State

  • [ ] Form state preserved on navigation away and back
  • [ ] State not reset by keyboard appearance or orientation change

Offline & Network Transitions

  • [ ] Clear offline indicator shown to the user
  • [ ] Cached data shown for read operations when offline
  • [ ] Destructive mutations require confirmation before queuing offline
  • [ ] Mid-request network drop handled with a timeout, not an infinite spinner
  • [ ] In-progress requests cancelled on screen unmount

Incorrect:

// No timeout — hangs forever on a slow network
const data = await fetch('/api/items');

Correct:

const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 10000);
try {
  const data = await fetch('/api/items', { signal: controller.signal });
} catch (e) {
  if (e.name === 'AbortError') showTimeout();
  else showError(e);
} finally {
  clearTimeout(timeout);
}

Transactions & Critical Actions

  • [ ] Success confirmed server-side, not from a client callback alone
  • [ ] Interruption handled (user kills the app mid-transaction)
  • [ ] External redirects (OAuth, 3DS) return cleanly to the app
  • [ ] POST requests not auto-retried on network restore (avoids duplicates)

Incorrect:

const onPay = async () => {
  await paymentSDK.charge(amount);
  navigation.navigate('Success'); // assumes success from the SDK alone
};

Correct:

const onPay = async () => {
  const sdkResult = await paymentSDK.charge(amount);
  const confirmed = await api.confirmPayment(sdkResult.transactionId);
  if (confirmed.status === 'success') {
    navigation.navigate('Success');
  } else {
    navigation.navigate('PaymentFailed', { reason: confirmed.reason });
  }
};

Anti-Patterns

| Anti-Pattern | Risk | Fix | |---|---|---| | useState + useEffect for API data | Race conditions, no cache, no retry | Use a query library | | Global store for server data | Stale data, manual refetching | Let the query library own it | | Direct fetch/axios in components | Untestable, no caching, repeated code | Abstract into query hooks | | Fire-and-forget async | Silent failures | Always handle errors | | Auto-retry POST on reconnect | Duplicate transactions | Retry only idempotent reads |

Pitfalls

  • staleTime: 0 (the default in many libraries) refetches on every screen focus, wasting bandwidth and battery.
  • Optimistic updates without rollback on error leave the UI in an impossible state.
  • Not cleaning up an AbortController on unmount triggers a state update on an unmounted component.
  • Showing stale cached data without an offline indicator makes users think it is current.
  • Not storing transaction intent before starting means an app crash equals lost state.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.