UI state คือ ข้อมูลที่แอปของคุณเป็นเจ้าของและควบคุมเฉพาะที่ (toggles, form inputs, selected tab) Server state คือ ข้อมูลที่อยู่บนเซิร์ฟเวอร์และเพียง cached บนไคลเอนต์ (fetched users, products, posts) พวกเขามีลักษณะพื้นฐานที่แตกต่างกันและต้องใช้เครื่องมือต่างกัน
ความแตกต่างหลัก
UI state Server state
Ownership you own it (client) the server owns it; client caches
Freshness always current can become STALE (server changed it)
Sync needed? no yes — refetch, invalidate, revalidate
Shared? usually one client shared across users/devices/tabs
Concerns just set/read it caching, loading, errors, retries, dedup
