apollo-link-token-refresh
apollo-link-token-refresh copied to clipboard
Check if client is online in react native?
if (
!navigator.onLine ||
(error instanceof TypeError &&
error.message === "Network request failed")
) {
console.log("Offline -> do nothing 🍵")
} else {
console.log("Online -> log out 👋")
// your custom action here
user.logout();
}
this doesn't work with react native.