react-frontend-patterns

Organize React frontends with per-feature Zustand stores and TanStack Query.

Updated Jan 15, 2026
One-click install
npx skills add https://github.com/fiatkongen/saurun-marketplace --skill react-frontend-patterns-fiatkongen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-frontend-patterns
Source: https://github.com/fiatkongen/saurun-marketplace/tree/main/plugins/saurun/skills/react-frontend-patterns
Command: npx skills add https://github.com/fiatkongen/saurun-marketplace --skill react-frontend-patterns-fiatkongen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

React projects often struggle with unclear state ownership, re-renders from global stores, and inconsistent data caching. This Skill provides a disciplined pattern for structuring frontends using per-feature Zustand stores and TanStack Query to keep concerns isolated and predictable.

Core Features & Use Cases

  • One store per feature domain to confine state and minimize unnecessary renders.
  • Selector-based access patterns to avoid broad re-renders and promote typed access.
  • TanStack Query patterns for server data with stable query keys and invalidation strategies.
  • Clear separation of concerns with provider setup, error boundaries, and page-level vs feature-level boundaries.
  • Use Case: Implement a feature like Product List with route-level data fetching, feature widgets, and isolated error boundaries.

Quick Start

  • Architect a React frontend using one Zustand store per feature and TanStack Query for all API data, with selectors and derived state.

Frequently Asked Questions about react-frontend-patterns

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

FAQPage Schema
How do I structure React state management to avoid unnecessary re-renders?

Structure React state management by creating one Zustand store per feature domain and using selector-based access patterns to confine state and prevent broad component re-renders.

What is the best way to manage server data caching in a React frontend?

Manage server data caching in a React frontend by centralizing API data with TanStack Query, utilizing stable query keys and invalidation strategies to ensure predictable data fetching and error handling.

How do I separate concerns when organizing complex React feature modules?

Separate concerns in complex React feature modules by establishing clear page-level versus feature-level boundaries, colocating state with consumers, and implementing isolated error boundaries for robust UI architecture.

Does this React frontend pattern work with route-level data fetching?

Yes, this React frontend pattern works with route-level data fetching by using TanStack Query for API data management and feature widgets with isolated error boundaries to handle complex UI implementations.

When should I use per-feature Zustand stores instead of a global store?

Use per-feature Zustand stores instead of a global store when you need to confine state ownership to specific domains, minimize unnecessary renders, and keep concerns isolated across different feature modules.