now i learning react native, can someone explain me? how to sum json data to text. example i have crypto json data in SAMPLE_DATA and i want to sum the current_price.
i read in documentation, its using reduce, but i don't understand how to apply
const reducer = (previousValue, currentValue) => previousValue + currentValue;
const HomeScreen = () => {
return(
<Text data={SAMPLE_DATA}>{current_price.reduce(reducer)</Text>
)
}
but it's error, i don't understand