I want to print keys and values inside jsx of react native, I get keys but also I want value simultaneously for that particular key.
{
Object.keys(Data).map((key, index) => {
return (
<View style= {{ flexDirection: 'row' }}>
<View>
<Text>{ key }</Text>
</View>
</View>
)
})
}
Object.entries(Data).map(([key,value]) =>or else{Data[key]}.Object.keysgives only keys, andObject.valuesgives only values, andObject.entriesgives both in an array. But anyway, if you have the key, you can just doData[key]to get the corresponding value too.