`import React, { Component } from ‘react’
import { View, Text } from ‘react-native’
import axios from ‘axios’
import Header from ‘./components/header’
export default class App extends Component{
constructor(props){
super(props);
this.state = {Albums:[]};
}
UNSAFE_componentWillMount(){
axios.get(‘http://192.168.1.100/index1.php’).
then(response=>this.setState({Albums:response.data})).
catch(error=>alert(error));
}
renderAlbum (){
return this.state.Albums.map(album=>
<View key={album.id}>
<Text>{album.id}</Text>
</View>
)
}
render(){
return(
<View style={{flex:1}}>
<Header headrName=”Album” />
{this.renderAlbum()}
</View>
)
}
}