react-native

Organize React Native components, hooks, and state management into testable structures.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/truongnat/emplus --skill react-native-truongnat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-native
Source: https://github.com/truongnat/emplus/tree/main/.agents/skills/react-native
Command: npx skills add https://github.com/truongnat/emplus --skill react-native-truongnat

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents messy, hard-to-test React Native code by enforcing consistent component structure, state management, and testing practices across iOS and Android.

Core Features & Use Cases

  • Functional component patterns: Encourages presentation components with explicit props to keep UI predictable.
  • Logic extraction to hooks: Moves side effects and data fetching into hooks so screens remain focused and easy to test.
  • State management guidance: Recommends local state first, then Zustand for global state, and React Query for server state.
  • Testing strategies: Covers component and hook testing with React Native Testing Library patterns.
  • Platform-specific organization: Uses iOS/Android file splits and minimizes Platform.select to reduce conditional complexity.
  • Use cases: When building a new screen (e.g., Home) with data loading, when adding server-backed features (e.g., creating items), or when implementing platform-specific UI differences safely.

Quick Start

Ask an AI to refactor your current React Native screen to follow the Skill’s patterns by extracting logic into hooks, standardizing props interfaces, choosing the correct state tool, and adding targeted tests for the critical components.

Frequently Asked Questions about react-native

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a React Native screen to separate business logic from rendering?

To separate React Native screen logic from rendering, extract side effects and data fetching into custom hooks. This keeps your functional components focused purely on UI presentation, making the screens predictable and significantly easier to test.

What is the best way to manage state in a React Native app with Zustand and React Query?

The best way to manage state in React Native is to use local component state first, Zustand for global app state, and React Query for server state. This pragmatic escalation prevents global store bloat and keeps data fetching isolated.

How do I organize platform-specific code for iOS and Android in React Native?

To organize iOS and Android platform-specific code in React Native, use platform-specific file splits rather than inline conditionals. This approach minimizes Platform.select complexity and keeps your platform-specific implementations cleanly separated.

How do I write deterministic tests for React Native components and hooks?

To write deterministic tests for React Native components and hooks, use React Native Testing Library patterns. By standardizing explicit prop typing and extracting logic into hooks, you ensure your components behave predictably during test execution.

Why does my React Native component become hard to test when mixing data fetching and UI?

Your React Native component becomes hard to test because mixing data fetching with UI creates unpredictable side effects. Extracting side effects into custom hooks enforces explicit prop interfaces, yielding deterministic component testing.

Can I use TypeScript to enforce explicit prop typing in React Native presentation components?

Yes, you can use TypeScript to enforce explicit prop typing in React Native presentation components. Defining clear interfaces for your props keeps your UI predictable and ensures your functional components remain testable.