Quantcast
Channel: React FlatList renderItem - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Mohit Sharma for React FlatList renderItem

$
0
0
import { places } from '../data/DataArray';

export const Home = (props) => {
    const renderPlace = ({ item }) => (
        <TouchableOpacity onPress={() => props.navigation.navigate('SingleTour')}>
            <Text style={styles.item}>{item.name}</Text>
        </TouchableOpacity>
    );
    return (
        <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
            <FlatList
                data={places}
                renderItem={
                    renderPlace
                }
            />
        </View>
    );
}

Viewing all articles
Browse latest Browse all 6

Trending Articles



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