Back to Skills

react-native-state

verified

Master state management - Redux Toolkit, Zustand, TanStack Query, and data persistence

View on GitHub

Marketplace

pluginagentmarketplace-react-native

pluginagentmarketplace/custom-plugin-react-native

Plugin

react-native-assistant

Repository

pluginagentmarketplace/custom-plugin-react-native
3stars

skills/react-native-state/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-react-native/blob/main/skills/react-native-state/SKILL.md -a claude-code --skill react-native-state

Installation paths:

Claude
.claude/skills/react-native-state/
Powered by add-skill CLI

Instructions

# React Native State Management Skill

> Learn production-ready state management including Redux Toolkit, Zustand, TanStack Query, and persistence with AsyncStorage/MMKV.

## Prerequisites

- React Native basics
- TypeScript fundamentals
- Understanding of React hooks

## Learning Objectives

After completing this skill, you will be able to:
- [ ] Set up Redux Toolkit with TypeScript
- [ ] Create Zustand stores with persistence
- [ ] Manage server state with TanStack Query
- [ ] Persist data with AsyncStorage/MMKV
- [ ] Choose the right solution for each use case

---

## Topics Covered

### 1. Redux Toolkit Setup
```typescript
// store/index.ts
import { configureStore } from '@reduxjs/toolkit';
import { authSlice } from './slices/authSlice';

export const store = configureStore({
  reducer: {
    auth: authSlice.reducer,
  },
});

export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
```

### 2. RTK Slice
```typescript
import { createSlice, PayloadAction } from '@reduxjs/toolkit';

interface AuthState {
  user: User | null;
  token: string | null;
}

export const authSlice = createSlice({
  name: 'auth',
  initialState: { user: null, token: null } as AuthState,
  reducers: {
    setUser: (state, action: PayloadAction<User>) => {
      state.user = action.payload;
    },
    logout: (state) => {
      state.user = null;
      state.token = null;
    },
  },
});
```

### 3. Zustand Store
```typescript
import { create } from 'zustand';
import { persist, createJSONStorage } from 'zustand/middleware';
import AsyncStorage from '@react-native-async-storage/async-storage';

interface AppStore {
  theme: 'light' | 'dark';
  setTheme: (theme: 'light' | 'dark') => void;
}

export const useAppStore = create<AppStore>()(
  persist(
    (set) => ({
      theme: 'light',
      setTheme: (theme) => set({ theme }),
    }),
    {
      name: 'app-storage',
      storage: createJSONStorage(() => AsyncStorage),
    }
  )
);
```

##

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3780 chars