refetchAfterFocus
Description: Reexecute the action on window focus.
Default Value: true.
- How To: Set
refetchAfterFocus: truefor data that should be fresh when the user returns to the application, such as user profiles, notifications, or shopping cart contents. This ensures the user always sees up-to-date information.// Correct: User profile data is refreshed when the window regains focususeFetch('current-user',fetchCurrentUser,{ refetchAfterFocus: true }); - Best Practice: Avoid
refetchAfterFocus: truefor data that doesn't need to be immediately fresh on focus, to prevent unnecessary network requests and potential server load.