React Query's select option enables fine-grained subscriptions by allowing components to subscribe only to specific parts of query data rather than the entire response. This prevents unnecessary re-renders when unrelated data changes. The feature supports structural sharing for referential stability and can be optimized further
•10m read time• From tkdodo.eu
Table of contents
Global State and SubscriptionsThe QueryHashFine-grained SubscriptionsWhat is select ?Typing Select AbstractionsSupercharging select with MemoizationThe Final Boss3 Comments
Sort: