Skip to content

Return stale data instead of error if fetch is aborted due to page unload #841

Answered by huozhi
hrabur asked this question in Ideas
Discussion options

You must be logged in to vote

@hrabur I'm not sure what kind of fetcher you're using, but you might be able to handle the error thrown from fetcher due to browser navigation. if the error is caused by navigation, you can ignore it and let fetcher resolve. swr will use the error thrown from fetcher as returning error.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@hrabur
Comment options

@huozhi
Comment options

Answer selected by hrabur
Comment options

You must be logged in to vote
2 replies
@huozhi
Comment options

@arnarleifs
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants