I cant seem to figure how to pass variable with typescript in react native, I have tried the params but its saying undefined is not an object (evaluating 'navigation.props.value').
below are the codes.
import {useNavigation} from '@react-navigation/core';const navigation = useNavigation();.......<TouchableOpacity onPress={() => navigation.navigate('NewsDetails', {value: 'hi', })}><Block row flex={0} align="center"><Text p color={colors.link} semibold size={sizes.linkSize} marginRight={sizes.s}> Read Article</Text><Image source={assets.arrow} color={colors.link} /></Block></TouchableOpacity>
then to display it in screen be this is what I had done but its not working
<Text p marginBottom={sizes.s}> {navigation.props.value}</Text>