This is my root component:
const App = () => (
<Provider store={store}>
<PersistGate persistor={persistor} loading={<LoadingView />}>
<MainTabNavigator />
</PersistGate>
</Provider>
)
export default App
And a pretty simple snapshot test for it:
describe('Testing root App component', () => {
test('Renders as expected', () => {
const tree = renderer.create(<App />).toJSON()
expect(tree).toMatchSnapshot()
})
})
When I run the test, it passes but I get this error message under it:
PASS __tests__/App.test.tsx
● Console
console.error node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5190
The above error occurred in the <TabView> component:
in TabView (created by withCachedChildNavigation(TabView))
in withCachedChildNavigation(TabView)
in Unknown (created by Navigator)
in Navigator (created by NavigationContainer)
in NavigationContainer (created by App)
in PersistGate (created by App)
in Provider (created by App)
in App
Consider adding an error boundary to your tree to customize error handling behavior.
Visit (url) to learn more about error boundaries.
Because the test passes, does this even matter? What's going on?