I'm using expo-router
in my React Native Expo app containing 2 screens, app/home.js
and app/details.js
. There is a Link
on home.js
that navigates to details.js
screen.
Right now both screens have the header on the top of the screen. Is there a way to disable the header only for the home.js
screen? After navigation from the home screen to the details screen, the header on the details screen should still show the back arrow for the user to navigate back up to the home screen.
app/_layout.js
import { Stack } from "expo-router";
import { SafeAreaProvider } from "react-native-safe-area-context";
export default function Layout() {
return (
<SafeAreaProvider>
<Stack
initialRouteName="home"
/>
</SafeAreaProvider>
);
}
headerShown
. You can set this tofalse
and have the same effect – Epileptic