Created
December 14, 2023 21:23
-
-
Save alperbayram/26f33f773a2171ef891ce7e4b309c688 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//app/(tabs)/user/[id].tsx | |
import { View, Text, Image } from "react-native"; | |
import { useLocalSearchParams, Stack, usePathname } from "expo-router"; | |
import { styles } from "../../../styles/styles"; | |
export default function Page() { | |
const pathname = usePathname(); | |
const local = useLocalSearchParams(); | |
return ( | |
<View style={styles.container}> | |
<Stack.Screen options={{ headerTitle: `user/${local.id}` }} /> | |
<Text style={styles.title}>user</Text> | |
<Image source={{ uri: local.image }} style={styles.image} /> | |
<View> | |
<Text style={styles.subtitle}>id: {local.id}</Text> | |
<Text style={styles.subtitle}>Name: {local.name}</Text> | |
<Text style={styles.subtitle}>Company: {local.company}</Text> | |
<Text style={styles.subtitle}>pathname: app{pathname}</Text> | |
</View> | |
</View> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment