Skip to content

Latest commit

 

History

History
executable file
·
26 lines (22 loc) · 931 Bytes

File metadata and controls

executable file
·
26 lines (22 loc) · 931 Bytes
id title sidebar_label
route-prop
Route prop reference
Route prop

Each screen component in your app is provided with the route prop automatically. The prop contains various information regarding current route (place in navigation hierarchy component lives).

  • route
    • key - Unique key of the screen. Created automatically or added while navigating to this screen.
    • name - Name of the screen. Defined in navigator component hierarchy.
    • path - An optional string containing the path that opened the screen, exists when the screen was opened via a deep link.
    • params - An optional object containing params which is defined while navigating e.g. navigate('Twitter', { user: 'Dan Abramov' }).
function ProfileScreen({ route }) {
  return (
    <View>
      <Text>This is the profile screen of the app</Text>
      <Text>{route.name}</Text>
    </View>
  );
}