Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vantuan88291
Copy link
Contributor

@vantuan88291 vantuan88291 commented Sep 2, 2021

Please verify the following:

  • yarn ci:test jest tests pass with new tests, if relevant
  • README.md has been updated with your changes, if relevant

Describe 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:
Simulator Screen Shot - iPhone SE (2nd generation) - 2021-09-02 at 15 55 53

Comment on lines +63 to +68
<ErrorBoundary catchErrors={"always"}>
<AppNavigator
initialState={initialNavigationState}
onStateChange={onNavigationStateChange}
/>
</ErrorBoundary>
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Member

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.

@jamonholmgren jamonholmgren merged commit 7e4e61f into infinitered:master Sep 14, 2021
infinitered-circleci pushed a commit that referenced this pull request Sep 14, 2021
# [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))
@infinitered-circleci
Copy link
Collaborator

🎉 This PR is included in version 7.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants