Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react native navigation.navigate with params

function HomeScreen({ navigation }) {
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Text>Home Screen</Text>
      <Button
        title="Go to Details"
        onPress={() => {
          /* 1. Navigate to the Details route with params */
          navigation.navigate('Details', {
            itemId: 86,
            otherParam: 'anything you want here',
          });
        }}
      />
    </View>
  );
}

function DetailsScreen({ route, navigation }) {
  /* 2. Get the param */
  const { itemId, otherParam } = route.params;
  // .....
Comment

react navigation params

navigation.navigate('Profile', { userId: 'jane' });
Comment

PREVIOUS NEXT
Code Example
Javascript :: exit extension from chrome javascript 
Javascript :: eslint ignore 
Javascript :: js selection box excel node 
Javascript :: javascript padend 
Javascript :: iterate formData 
Javascript :: clear session storage on refresh 
Javascript :: jquery remove closest parent 
Javascript :: what can i delete from create-react-app 
Javascript :: js check if radio button is checked 
Javascript :: useLocation in jest 
Javascript :: angular window object 
Javascript :: convert to datetime in jquery 
Javascript :: return the next higher prime number javascript 
Javascript :: for loop infinite javascript 
Javascript :: get all local storage 
Javascript :: Module Error (from ./node_modules/eslint-loader/dist/cjs.js): 
Javascript :: javascript game loop 
Javascript :: react native linking email 
Javascript :: set cookie in node 
Javascript :: javascript check if number is integer 
Javascript :: ip regex javascript 
Javascript :: javascript set element width 
Javascript :: toggle hidden attribute javascript 
Javascript :: vue get store state 
Javascript :: Javascript find element with focus 
Javascript :: vuejs scroll to top 
Javascript :: USA phone number validator angular 
Javascript :: random color code js 
Javascript :: js window active 
Javascript :: what is the use of angularjs 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =