Adding Pages
Overview
ShipNative uses expo app router to handle navigation. Expo router natively supports, a slot, stack, tab, and drawer navigation. To learn more about expo router, read the docs. By default, ShipNative uses a tab navigator + stack navigator to manage the content of the app.
New Page Template
Use this as a template for new pages that you create
import { Details } from "@/components/generic/Details";
import { SafeAreaView, ScrollView, View } from "react-native";
export default function ExamplePage () {
return (
<SafeAreaView className="flex-1 bg-background">
<ScrollView className="px-screen py-screenLg">
<View className="pb-8 flex gap-12">
{/* Your page here */}
</View>
</ScrollView>
</SafeAreaView>
)
}Use bg-background to make the background something other than pure white/pure black
Use SafeAreaView to avoid the notch/handlebar
Use ScrollVew with horiznotal and vertical padding
Use a View in side the ScrollView because ScrollView does not support css gap
v2
Fixes scrollview height issue
Adding a new tab
How to create a new tab in the Tab Navigator
In the folder
app/content/tabs/, add a new fileexampleTab.tsxand add paste in this template
Open
app/content/tabs/_layout.tsx, add a new Tab Screen for that screen
Adding a new stack screen
How to add a route to the stack navigator. These pages with pop open with a back button
In the folder
app/content/, add a new fileexamplePage.tsxand fill it with the new page template
Open
app/content/_layout.tsx, add a new Stack Screen for that screen
Last updated