here is my data.js file from which I am getting data
const data2 =
[
{
key:1,
about: "AC services",
description: "description about service",
},
{
key:2,
about: "Baby sitter",
description: "description about service"
},
{
key:3,
about: "Electronics",
description: "description about service"
},
.
.
.
]
export default data2;
here is my code where I am using map function to fetch data
import React from 'react';
import { Container, Header, Content, List, ListItem, Text, Left, Body, Right, Button, Thumbnail, Title } from 'native-base';
import data from '../Constant/data'
const ServiceList = (props) => {
return (
<Container>
<Header>
<Body>
<Title> Services List </Title>
</Body>
</Header>
<Content>
<List>
{data.map(obj =>
<ListItem thumbnail>
<Left>
<Text>{obj.key}</Text>
<Thumbnail square source={require('../Assets/serviceIcons/ac.png')} /> **want to get all image also**
</Left>
<Body>
<Text>{obj.about}</Text>
</Body>
<Right>
<Button transparent onPress={() => props.navigation.navigate('BookPage',{obj:obj})}>
<Text>View</Text>
</Button>
</Right>
</ListItem>
)}
</List>
</Content>
</Container>
);
}
export default ServiceList;
result enter image description here
my problem is, I want to fetch the image URL from the data file so that every icon can be rendered also, but I don't know how to code URL in the data file and fetch that into component