-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add handle exception screen #1787
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
Add handle exception screen #1787
Conversation
# [6.8.0](infinitered/ignite@v6.7.0...v6.8.0) (2021-04-18) ### Bug Fixes * **boilerplate:** Fix keyboard avoid view behaviour ([infinitered#1650](infinitered#1650) by [@dani-z](https://github.com/dani-z)) ([b8178e8](infinitered@b8178e8)) * **boilerplate:** Update style prop types ([infinitered#1656](infinitered#1656) by [@kateinkim](https://github.com/kateinkim)) ([79da392](infinitered@79da392)) * **flipper:** bump flipper version to fix event error ([infinitered#1643](infinitered#1643) by [@kimyoungjae96](https://github.com/kimyoungjae96)) ([fe1efec](infinitered@fe1efec)) * **types:** Improved types ([infinitered#1648](infinitered#1648) by [@danyim](https://github.com/danyim)) ([635c988](infinitered@635c988)) ### Features * **boilerplate:** add keyboardShouldPersistTaps to screen; default to handled ([infinitered#1644](infinitered#1644) by [@kateinkim](https://github.com/kateinkim)) ([7dfba0b](infinitered@7dfba0b))
| <ErrorBoundary catchErrors={"always"}> | ||
| <AppNavigator | ||
| initialState={initialNavigationState} | ||
| onStateChange={onNavigationStateChange} | ||
| /> | ||
| </ErrorBoundary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion, not required for this PR: I find that it's generally good practice to also wrap screens within a navigator with an error boundary, so that navigation can continue to work if a component only nested within a single screen fails. I think it's helpful to be able to recommend that in a best-practices template.
However, this is mostly useful in apps that have navigation menus/bars outside the screen components (making sure those continue to work), so maybe it won't be super clear why that's helpful in this particular layout. Curious for your thoughts @jamonholmgren. I could see an argument for a separate PR that introduces an example navigation menu and then wraps individual screens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lindboe I think we should get a fresh new design for Ignite's boilerplate and add either a drawer or tab bar, after which we could incorporate your suggestion.
# [7.5.0](v7.4.2...v7.5.0) (2021-09-14) ### Features * **boilerplate:** Add error boundary component ([#1787](#1787) by [@vantuan88291](https://github.com/vantuan88291) and [@jamonholmgren](https://github.com/jamonholmgren)) ([7e4e61f](7e4e61f))
|
🎉 This PR is included in version 7.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Please verify the following:
yarn ci:testjest tests pass with new tests, if relevantREADME.mdhas been updated with your changes, if relevantDescribe your PR
As we know, when the app has a JS exception, it will throw White screen instead Red screen in release mode. So i added error screen let user can reload app when some exception was happened. Its look like bellow:
