I want to render items from props, I can do it with initial state, but not with response from server. My render function :
const { data } = this.props;
return (
<div >
{data.map((item, index) =>
<div key={index} className="row">
<span data = { data } className="number col-4 col-md-8">{item._id}</span>
<span data = { data } className="date col-4 col-md-2">{item.date}</span>
<span data = { data } className="tag col-4 col-md-2">{item.tag}</span>
<div className="col-md-12 ">
{item.text}
</div>
</div>
)}
</div>
)
}
I get this mistake :
TypeError: e.map is not a function
response : Object {data: Array(12), status: 200, statusText: "OK", headers: Object, config: Object…}
e.mapin your code?