refetchAfterHydrate
Description: Reexecute the action after the component has been hydrated.
Default Value: true.
- How To: Use
refetchAfterHydrate: truewhen you want to ensure the data is always fresh after hydration, even if it was pre-fetched on the server. This can be particularly useful for highly dynamic content where the server-rendered data might already be slightly outdated by the time the client hydrates.// Correct: Ensure latest news feed after hydrationuseFetch('news-feed',fetchNewsFeed,{ refetchAfterHydrate: true }); - Best Practice: Avoid
refetchAfterHydrate: truefor static or less critical data to reduce client-side refetches immediately after page load, which can impact perceived performance.