React native state management

From HoangNguyen0403/agent-skills-standard · View interactive version

React native state management is an AI agent skill from the GitHub repository HoangNguyen0403/agent-skills-standard. Implement local and global state with Context, Zustand, and Redux Toolkit in React Native. Use when choosing or implementing state management in React Native with Context, Zustand, or Redux.

How to use this skill

Skill file

React Native State Management

**Priority: P1 (HIGH)**

State Strategy

const ThemeContext = createContext<ThemeContextType | undefined>(undefined);

export function useTheme() {
  const ctx = useContext(ThemeContext);
  if (!ctx) throw new Error('useTheme must be inside ThemeProvider');
  return ctx;
}

Zustand (Recommended for Most Apps)

import { create } from 'zustand';

const useStore = create((set) => ({
  count: 0,
  increment: () => set((state) => ({ count: state.count + 1 })),
}));

// Usage
const count = useStore((state) => state.count);

Anti-Patterns

References

See references/REFERENCE.md for Context patterns, Zustand store setup, Redux Toolkit, and React Query.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.