State Management · Middle · Question 61 of 75
How does initialData differ from placeholderData in TanStack Query?
- ✓Correct answer:
initialDatais treated as real cached data;placeholderDatais shown temporarily and never persisted to the cache - 2They are identical
- 3
placeholderDatais fetched from the server
Explanation
Use initialData when you truly have the data (e.g. from a list); use placeholderData for previews or keeping previous data while fetching.