Hi,
I am trying to render a table of the users collection in react. However I can’t get the createdAt date and email to get shown? What am I missing?
This is my code:
<td>{this.props.user._id}</td>
<td>{this.props.user.username}</td>
<td>{this.props.user.emails[0].address}</td>
<td>{alert(this.props.user.createdAt)}</td>
This is inside mongo:
meteor:PRIMARY> db.users.find({})
{ "_id" : "fYKbnmKQhnfbFgY2m", "createdAt" : ISODate("2016-10-28T19:18:57.676Z"), "services" : { "password" : { "bcrypt" : "$2a$10$YsOAjbKB9hx3yS.q04UUmOO0b3al0al214xFuWT3RwVjAI4DJmYge" } }, "username" : "John", "emails" : [ { "address" : "johndoe@me.com", "verified" : false } ] }
Console log is showing this error:
TypeError: Cannot read property '0' of undefined