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 :: string javascript concatenation 
Javascript :: sort array descending 
Javascript :: error handling in node.js 
Javascript :: three js html 
Javascript :: image react native base64 
Javascript :: Simplest Promise Example 
Javascript :: $(...).DataTable is not a function 
Javascript :: lodash groupby return array 
Javascript :: how to check if it is the current time day.js 
Javascript :: CHECKING TYPE OF ARRAY 
Javascript :: map function in js 
Javascript :: do i need to know javascript to learn three.js 
Javascript :: send a message in every guild discord.js 
Javascript :: change icon on click angular 
Javascript :: npm fund 
Javascript :: addeventlistener js 
Javascript :: js insert 
Javascript :: store fetch data in variable javascript 
Javascript :: how to open cypress 
Javascript :: update a value from array in redux state 
Javascript :: Recursion In DOM 
Javascript :: Format javascript date with date.js library 
Javascript :: splice in javascript 
Javascript :: how to select a dom element in react 
Javascript :: For-each over an array in JavaScript 
Javascript :: google js console 
Javascript :: convert string to array with condition javascirpt 
Javascript :: combineReducers. 
Javascript :: javascript delete element of an array 
Javascript :: js days to hours 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =