Closed vendeza closed 2 years ago
Since you're using ReactNavigation 6, you're going to want to wrap NavigationContainer
rather than App
.
You can wrap the navigation container like this:
const HeapNavigationContainer = Heap.withReactNavigationAutotrack(NavigationContainer);
Once wrapped, you use <HeapNavigationContainer/>
as a drop-in replacement for <NavigationContainer/>
in your code:
return (
<HeapNavigationContainer theme={DarkTheme}>
<Screens.Navigator options={options}>
<Screens.Group>
<Screens.Screen
name={'StartScreen'}
options={options}
component={StartScreen}
/>
</Screens.Group>
</Screens.Navigator>
</HeapNavigationContainer>
);
Your App.jsx should then export App
as it was doing before rather than the wrapped HeapNavigationContainer
.
@bnickel thanks!
I've got the next warning:
App.js component:
"react": "17.0.2", "react-native": "^0.66.4", "@heap/react-native-heap": "^0.21.0", "@react-navigation/bottom-tabs": "^6.0.9", "@react-navigation/elements": "^1.2.1", "@react-navigation/material-top-tabs": "^6.0.6", "@react-navigation/native": "^6.0.6", "@react-navigation/stack": "^6.0.11",
Do you have any idea why it happened?