hjemmesidekongen/ai/expo-data-fetching

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Data fetching in Expo — fetch, React Query, SWR, offline support, and caching strategies

Install

npx vskill@latest install hjemmesidekongen/ai/expo-data-fetching

SKILL.md

Expo Data Fetching

React Native has fetch built in — but raw fetch in useEffect creates unreliable, verbose patterns. React Query is the standard for server state in Expo apps.

React Query Setup

Wrap the root layout in QueryClientProvider. Set staleTime, retry, and refetchOnWindowFocus: false in defaults — mobile apps don't have browser windows, so the default focus refetch fires unexpectedly without this.

Query and Mutation

tsx
const { data, isLoading, error } = useQuery({
queryKey: queryKeys.users.detail(userId),
queryFn: () => fetchUser(userId),
enabled: !!userId,
});
const mutation = useMutation({
mutationFn: updateUser,
onSuccess: (user) =>
queryClient.invalidateQueries({ queryKey: queryKeys.users.all }),
});

Key Rules

  • Use React Query for all remote server state. Local UI state stays in useState.
  • Define query keys as typed constants — never inline strings across files.
  • Always handle isLoading and error before accessing data.
  • Set staleTime in defaults to reduce unnecessary refetches on screen focus.
  • For offline-first, persist the query cache with MMKV or AsyncStorage.

See references/process.md for SWR patterns, offline strategies (AsyncStorage, MMKV, WatermelonDB), optimistic updates, infinite queries, cache persistence, error handling, type-safe fetching, and anti-patterns.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/hjemmesidekongen/ai/expo-data-fetching/badge)](https://verified-skill.com/skills/hjemmesidekongen/ai/expo-data-fetching)

Something wrong with this skill or its page? Tell us.