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

Problem with opening screen with onPress in React Native

$
0
0

I dont have any errors but I still cant open screen that I want. Here is my FlatList item:

let categories = [         {            screenName : Player,            name : "Category 1",            img : require("../Assets/Slika.jpg"),        },

Here is TouchableOpacity with onPress

return (<View style={styles.container}><FlatList                    data={categories}                    showsHorizontalScrollIndicator={false}                    numColumns={categories.length / 5}                    showsVerticalScrollIndicator={false}                    keyExtractor={(item, index) => index.toString()}                    renderItem = {({item, index}) => {                        return (<TouchableOpacity onPress={() => item.screenName}><Surface style={styles.surface}><ImageBackground                            source={item.img}                             style={styles.img}                            blurRadius={0.5}><Icon name="music" color="#fff" size={22}/><Text style={styles.name}>{item.name}</Text></ImageBackground></Surface></TouchableOpacity>                        );                    }}                /></View>

Viewing all articles
Browse latest Browse all 16750

Trending Articles



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