Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

React Native - navigation is undefined

import { useNavigation } from '@react-navigation/native'; 

const Item = ({item}) => {
  const navigation = useNavigation();
  return (
    <TouchableOpacity onPress={() => navigation.navigate('ProfileScreen')}>
      <Text
        style={{
          textAlign: 'left',
          color: 'white',
          fontSize: 24,
          fontFamily: 'Montserrat_100Thin_Italic',
        }}>
        <Image
          style={{alignSelf: 'center', borderRadius: 50}}
          source={{uri: item.profile_picture, width: 48, height: 48}}
        />
        {item.username}
      </Text>
    </TouchableOpacity>
  );
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: cypress type force 
Javascript :: javascript read xlsx file 
Javascript :: upsert mongoose 
Javascript :: javascript is object array 
:: google script get date without time 
Javascript :: regex only letters not spaces 
Javascript ::  
Javascript :: js make element invisible 
Javascript :: js insert string at position 
Javascript :: javascript clear table body 
Javascript :: react native button 
Javascript :: how to add variable to local storage in javascript 
Javascript :: how to capitalize string in javascript 
Javascript ::  
Javascript :: Count Backwards With a For Loop 
Javascript :: disable mouse right click javascript 
Javascript ::  
::  
Javascript ::  
Javascript :: javascript find smallest number in an array 
Javascript ::  
::  
::  
Javascript :: js remove all objects from array where value 
Javascript ::  
Javascript ::  
::  
:: Uncaught ReferenceError: function is not defined at HTMLUnknownElement.onclick 
Javascript :: reactjs app change port 
::  
ADD CONTENT
Topic
Content
Source link
Name
2+2 =