Untitled

 avatar
user_9363972
javascript
7 months ago
1.1 kB
3
Indexable
Never
<FlatList
        contentContainerStyle={styles.flatListContainer}
        data={data}
        keyExtractor={item => item.id}
        keyboardShouldPersistTaps={'handled'}
        ListEmptyComponent={
          <View>
            <Text style={{textAlign: 'center'}}>Empty !</Text>
          </View>
        }
        showsVerticalScrollIndicator={false}
        renderItem={({item}) => {
          return (
            <View style={styles.mainDataContainer}>
              <TouchableOpacity
                style={styles.noteButton}
                onPress={() =>
                  navigation.navigate('EditNote', {
                    id: item.id,
                  })
                }>
                <View style={styles.noteContainer}>
                  <Text style={styles.noteText}>{item.name}</Text>
                  <Text style={styles.noteText}>{item.phone}</Text>
                </View>
                <Text style={styles.dateText}>{item.date}</Text>
              </TouchableOpacity>
            </View>
          );
        }}
      />
Leave a Comment