Skip to content

Instantly share code, notes, and snippets.

@NaveenDA
Created April 30, 2021 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NaveenDA/72c84aec0d70e7d2bddc03d28d1e114c to your computer and use it in GitHub Desktop.
Save NaveenDA/72c84aec0d70e7d2bddc03d28d1e114c to your computer and use it in GitHub Desktop.
import React from "react";
import { SWRConfig } from "swr";
const App = () => {
return (
<SWRConfig
value={{
onError: (error, key) => {
if (error.status !== 403 && error.status !== 404) {
// We can send the error to Sentry,
// or show a notification UI.
}
}
}}
>
<MyApp />
</SWRConfig>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment