Answers for "react native use route params"

0

react native use route params

import * as React from 'react';
import { Text } from 'react-native';
import { useRoute } from '@react-navigation/native';

function MyText() {
  const route = useRoute();

  return <Text>{route.params.caption}</Text>;
}
Posted by: Guest on June-30-2021
0

react native use route params

navigation.navigate('RouteName', { /* params go here */ })

to recieve the params

function DetailsScreen({ route, navigation }) {
  const { itemId, otherParam } = route.params;
  return(<Text>itemId<Text>);
}
Posted by: Guest on June-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language