expo-router
Version:
Expo Router is a file-based router for React Native and web applications.
19 lines (18 loc) • 572 B
TypeScript
/**
* Returns the currently selected route location without search parameters. For example, `/acme?foo=bar` returns `/acme`.
* Segments will be normalized. For example, `/[id]?id=normal` becomes `/normal`.
*
* @example
* ```tsx app/profile/[user].tsx
* import { Text } from 'react-native';
* import { usePathname } from 'expo-router';
*
* export default function Route() {
* // pathname = "/profile/baconbrix"
* const pathname = usePathname();
*
* return <Text>Pathname: {pathname}</Text>;
* }
* ```
*/
export declare function usePathname(): string;