Skip to content

Instantly share code, notes, and snippets.

@alperbayram
Last active December 15, 2023 08:36
Show Gist options
  • Save alperbayram/84044f0bab00ec79535514ecd95a97dc to your computer and use it in GitHub Desktop.
Save alperbayram/84044f0bab00ec79535514ecd95a97dc to your computer and use it in GitHub Desktop.
//user/[id].tsx
import { View, Text, Image, TouchableOpacity } from "react-native";
import { useLocalSearchParams, router, usePathname } from "expo-router";
import { styles } from "../../styles/styles";
export default function Page() {
const pathname = usePathname();
const local = useLocalSearchParams();
return (
<View style={styles.container}>
<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>
<TouchableOpacity onPress={router.back}>
<Text style={styles.linktitle}>{"< "}Back</Text>
</TouchableOpacity>
</View>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment