React Native .map function not returning a View or Text
I'm writing a map function in React Native and no matter what I have tried, I cant get it to return a View or Text. The console.log on line 132 returns valid data, so I know its going into the map function, but it is not returning the View. I have tried:
- state.map((stock, i) => {})
- state.map((stock, i) => ())
- state.map((stock,i) =>
I have tried with and without the return(), but it just displays nothing.
<ScrollView>
<Text style={styles.whitetext}>Hello...</Text>
{state.map((stock, i) => {
console.log(stock)
return (
<View key={i}>
<Text style={styles.whitetext} key={i}>test {stock.symbol}</Text>
</View>
)
})}
</ScrollView>
The console.log returning a value
The displayed screen
Any help would be greatly appreciated! Thank you.
from Recent Questions - Stack Overflow https://ift.tt/2T9THz4
https://ift.tt/eA8V8J
Comments
Post a Comment