I'm trying to limit the elements, in this case the posts, I just want to show 4 posts.
My Code:
componentDidMount() {
return fetch(ConfigApp.URL+'json/data_posts.php')
.then((response) => response.json())
.then((responseJson) => {
this.setState({
isLoading: false,
dataPosts: responseJson
}
})}
render() {
return (
<FlatList
data={ this.state.dataPosts }
renderItem={({item}) =>
<Image source={{uri: ConfigApp.IMAGESFOLDER+item.post_image}}/>
keyExtractor={(item, index) => index}
/>