I'm implementing my first react native project & it seems the best way to handle errors is with an app-level Error Boundary. I'm struggling to figure our how to integrate that with react-native-navigation. Current code looks like this:
# App.js
...
const startApp = () => {
Navigation.startSingleScreenApp({
screen: {
screen: 'App.Splash',
navigatorStyle: {
navBarHidden: true,
},
},
});
};
export function startTabs() {
registerScreens(store, Provider);
sagaMiddleware.run(RootSaga);
loadIcons().then(() => {
// Start app only if all icons are loaded
startApp();
});
}
startTabs();
And the screens.js:
# app/Screens.js
...
export default function registerScreens(store, Provider) {
Navigation.registerComponent('App.Splash', () => SplashContainer, store, Provider);
...
});
Because Navigation.startSingleScreenApp doesn't return a component, I'm struggling to figure out how to wrap an error boundary either immediately inside or outside the navigator. I tried scouring through react-native-navigation documentation, but couldn't find much help. Any ideas appreciated.