Mobile and desktop apps · Skill

Configure Expo data loading

configure-expo-data-loading

Loads data in an Expo project with expo/fetch, four screen states, and an Expo Router loader. Use when the user wants a network request, a loading state, or useLoaderData.

Works with: Any AI Not yet model-tested; testing Jan 2027

Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/configure-expo-data-loading/raw' -o ~/'.claude/skills/configure-expo-data-loading/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/configure-expo-data-loading/files/LICENSE.txt' -o ~/'.claude/skills/configure-expo-data-loading/LICENSE.txt'

Cursor (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/configure-expo-data-loading/raw' -o '.cursor/skills/configure-expo-data-loading/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/configure-expo-data-loading/files/LICENSE.txt' -o '.cursor/skills/configure-expo-data-loading/LICENSE.txt'

Codex and other Agent Skills tools (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/configure-expo-data-loading/raw' -o '.agents/skills/configure-expo-data-loading/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/configure-expo-data-loading/files/LICENSE.txt' -o '.agents/skills/configure-expo-data-loading/LICENSE.txt'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

A screen that loads data needs four states: loading, failure, empty, and content. Empty means the request finished with nothing to show. It is not the same as still waiting.

When to use

  • An Expo screen calls a network endpoint.
  • The person sees a blank list when the request fails.
  • Expo Router should load data with useLoaderData.

When not to use

  • The need is motion or a gesture. That is a separate skill.
  • The need is an over-the-air bundle. That is a separate skill.
  • The product is a website form. That is a separate skill.

Steps

  1. Prefer expo/fetch for the request. Do not add a second HTTP client for a simple call.
  2. Draw loading, failure, empty, and content. A first load uses the loading state. A later refresh keeps the cached rows and shows a small failure if the refresh does not succeed.
  3. Empty is a finished result with zero rows. Say why it is empty and offer the next action. Do not treat a missing response as empty.
  4. While a save is in flight, block a second submit. On failure, keep the draft. Clear it only after success.
  5. For an Expo Router screen that can load ahead of render, use useLoaderData. Wait until saved session state has loaded, then choose the first screen.
  6. Read the four states through, then write the failure path so a bad response does not wipe cached rows. Do not paste an API key into a sample. This library did not send a request.

Gotchas

  • Do not include passwords, tokens, or private payloads in sample calls.
  • A disabled or paused query can have no rows without being in the loading state. Show that case on its own.
  • Environment URLs belong in the project config, not in a pasted sample.
  • This is an independent how-to adapted from an Expo skill. It is not official Expo documentation, and no request was sent for this library.

Portability

If you use TanStack Query or SWR, the same four states still hold. If you use a bare fetch outside Expo, keep expo/fetch only when the project is Expo. If you use a website stack, this skill does not cover it.

Done when

  • The screen has loading, failure, empty, and content.
  • A failed refresh keeps cached rows.
  • useLoaderData is used only where the router can load ahead of render.

Example prompt

"This Expo list goes blank when the request fails. Keep the cached rows, and use expo/fetch with a real empty state."

---

Adapted from "expo-data-fetching" by 650 Industries, Inc. (aka Expo) (MIT, Copyright (c) 2025-present 650 Industries, Inc. (aka Expo)). See LICENSE.txt.

Bundled files

Licence

Adapted from Expo / 650 Industries (expo/skills, expo-data-fetching) (Copyright (c) 2025-present 650 Industries, Inc. (aka Expo)), MIT License. Adapted by TheSkillVault: rewritten as a short data-loading pass (expo/fetch, four states, loader, cached rows); dropped the client catalogue and auth recipes. Independent how-to, not official Expo documentation. No request was sent for this library.

Licence: MIT License. Attribution when you reuse it: Based on work by Expo / 650 Industries (expo/skills, expo-data-fetching) (Copyright (c) 2025-present 650 Industries, Inc. (aka Expo), MIT License), https://github.com/expo/skills/tree/a9e5bd3fa00b4e61f632e43f85da73aee1942582/plugins/expo/skills/expo-data-fetching; adapted by TheSkillVault, https://theskillvault.ai