-
Notifications
You must be signed in to change notification settings - Fork 935
Common Offline Error, Need an errorable component pattern #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here's what I'm thinking as a pattern:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Here's a couple StackOverflow questions that hit on this:
I am attracted to this solution that wraps a lot of the code in a component, so that if it fails a React
ErrorBoundary
can be triggered. However, I'm having a hard time refactoring this in TypeScript due to a lack of React-Google-Maps docs for TS. Plus, I'm not sure the solution'sGoogleMapsWrapper
would fail in a way that would trigger anErrorBoundary
.Here's the code I have, mostly boilerplate:
Regardless, a lot of example code uses Recompose due to the necessary HOC's, but by building components this way they don't fail in a way that allows React's
componentDidCatch
to get triggered. Instead you get errors likeUncaught ReferenceError: google is not defined
which do not allow any component to render when a page goes offline.What is a better pattern?
The text was updated successfully, but these errors were encountered: