I am new to React. I want to print out an array of objects in the view.
In my render() method of App component, I tried this:
render() { return ( <div> Your data: { this.props.val.map( (s, i) => <Details key={i} data={s} /> ) } </div> ); } And In Details Component:
class Details extends Comment{ rendeer(){ return ( <div> <span>{this.props.data.name} {this.props.data.cgpa}</span> </div> ); }}; Note: Both the components are in the same file. And i am facing this error=> 
But if i do this instead of calling details component:
Your data:<br /> { this.props.val.map( (s, i) => <p key={i}>{s.name} {s.cgpa}</p> ) } It works perfectly fine.
Commentclass? Shouldn't it beComponentinstead?