Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React Native Typescript FlatList ListRenderItem add if statement

$
0
0

I am trying to add if statement to my code:

   const movieList: ListRenderItem<any> = ({ item }) => (        //THIS IS WHAT I WANT TO ADD: item.poster_path !== null &&<View style={styles.movie}><Image style={styles.image} source={{ uri: 'example'+ item.poster_path }} /></View>    );    return (<FlatList                        numColumns={2}                        keyExtractor={(movie) => movie?.id.toString()}                        data={movies}                        renderItem={movieList}                    />    )

But, I can't add this in this way. How can I add this?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>