Open Tomvkgames opened 2 years ago
Moving const Stack = createSharedElementStackNavigator();
outside the scope fixed the issue:
const HomeTab = () => {
const Stack = createSharedElementStackNavigator();
TO
const Stack = createSharedElementStackNavigator();
const HomeTab = () => {
Thanks! We actually faced the same problem too, did not realise this was ever a problem until createSharedElementStackNavigator
, and we decided to migrate all our other navigators to be created at the top-level as well to possibly save some re-renders.
Please also see this stackoverflow question: https://stackoverflow.com/questions/70857346/shared-navigation-infinite-loop-react-native.
The ListView in the title references here to Home component.
When clicking om image on Home program gets stuck in infinite loop: first it renders the HomeTab component again -> Home component -> Detail (renderDetail is not rendered again in this loop).