Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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>;
}
Comment

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>);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: sweet alert 2 react 
Javascript :: preventdefault javascript 
Javascript :: how to test if an element has a class in testing library 
Javascript :: without refresh update url in js 
Javascript :: javascript add id to element with class 
Javascript :: react js alert popup example 
Javascript :: indexof javascript duplicate arrays 
Javascript :: angular get name of component 
Javascript :: how to import npm module 
Javascript :: js map key value 
Javascript :: infinit for loop js 
Javascript :: dynamic array in javascript 
Javascript :: trigger keyboard event javascript 
Javascript :: javascript check if element has specific child 
Javascript :: javascript add to html 
Javascript :: get year from date in mongodb 
Javascript :: jquery dynamic event binding 
Javascript :: global axios vue 2 
Javascript :: code intialization problem javascript 
Javascript :: remove trailing zeros javascript 
Javascript :: An invalid form control with ... is not focusable. 
Javascript :: javascript get cursor position without event 
Javascript :: jquery timer countdown 
Javascript :: js string to boolean 
Javascript :: create javascript array with 1 value 
Javascript :: office check in 
Javascript :: buildpack for nodejs 
Javascript :: collapse in angular 4 
Javascript :: spread operator javascript 
Javascript :: entypo icons react native 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =