Hi all, I'm working on a feature, where if the user tries to submit something with fetcher.submit() without an internet connection there will be an error message shown and the pages state will remain without a route change. Right now, the errors bubbles up in anticipation to meet caught by an error boundary which is not what I want to do.
#fetcher.submit() error catching
1 messages · Page 1 of 1 (latest)
Your best bet is to use window.navigator.onLine to check if a user is offline and if they are swap out the button events where you never call the fetcher if it is offline.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine
Returns the online status of the browser. The property returns a boolean value, with
true meaning online and false meaning offline. The property
sends updates whenever the browser's ability to connect to the network changes. The
update occurs when the user follows links or when a script requests a remote page. For
example, the property s...
@timid tinsel genius thank you