I am trying to fetch facebook movie data using axios. In my console, I see the fetched data, but I have trouble getting when I want to access the title text.
class BoardScreen extends Component {
constructor(props) {
super(props);
this.state = { movies: [] };
}
componentWillMount() {
axios.get('https://facebook.github.io/react-native/movies.json')
.then(response => this.setState({ movies: response.data }));
}
renderMovies() {
return this.state.movies.movies.map(movies => <Text>{movies.title}</Text>)
}
render() {
if(this.state.movies.length === 0) {
return null;
}
console.log(this.state.movies.title, 'movies')
return (
<View>
{this.renderMovies()}
</View>
)
}
}
The code above only will give me the main title text The Basics - Networking What I really want is to access to each movie title and display.
How could I fetch each array title?