Skip to content

Instantly share code, notes, and snippets.

@alperbayram
Created December 14, 2023 21:23
Show Gist options
  • Save alperbayram/26f33f773a2171ef891ce7e4b309c688 to your computer and use it in GitHub Desktop.
Save alperbayram/26f33f773a2171ef891ce7e4b309c688 to your computer and use it in GitHub Desktop.
//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