In react native, even though App is the initial entry point but Home screen is called first. Is it because Home is the initialRouteName defined in the NavigationContainer. If so, then how to initiate Home screen only after App component completes its operation in useEffect method.
function App(): JSX.Element {
useEffect(() => {
console.log("App");
}, []);
return (
<AppNavigation></AppNavigation>
);
}
const AppNavigation = () => {
return (
<NavigationContainer>
<Stack.Navigator >
<Drawer.Navigator
initialRouteName="home"
>...
</Drawer.Navigator>
</NavigationContainer>
);
};
2
Answers
Solution:
Please check the index.js file:
In your case:
The entry point may changed to home:
Solution:
You can try by adding the modified module & line: