I am trying to add my local directory image into the leftAvatar but cant achieve it, also there is no such document hint for doing so.Any help would be really appreciated. This is my render method-
render() {
return (
<View>
<FlatList
data={this.state.data}
renderItem={({ item }) => (
<ListItem
leftAvatar={{
source: { uri: "../assets/images/classboard.png" },
showEditButton: false
}}
title={`${item.className} ${item.section}`}
subtitle={item.countStudents.toString()}
containerStyle={{ borderBottomWidth: 1 }}
/>
)}
keyExtractor={item => item.classId.toString()}
// ItemSeparatorComponent={this.renderSeparator}
// ListHeaderComponent={this.renderHeader}
// ListFooterComponent={this.renderFooter}
// onRefresh={this.handleRefresh}
// refreshing={this.state.refreshing}
// onEndReached={this.handleLoadMore}
// onEndReachedThreshold={50}
/>
</View>
);
}
}
If you want to use your local resource you can do this:
source: require("../assets/images/classboard.png"),
Tell me if this is what you're looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With