constructor(props){
super(props);
this.state = {
posts: null,
date: null
};
}
componentDidMount(){
axios.get('http://www.mocky.io/v2/5a0b3479320000a504e963b9')
.then(res => {
const posts = res.data.items;
const date = res.data.feature;
this.setState({posts, date});
})
.catch(function (error) {
console.log(error);
});
};
render(){
const obj = this.state.posts;
const slide = this.state.date;
return (
<div>
<CardBlock items = {obj || []} />
<ShowMoreBlock/>
</div>
)
}
}