I'm developing an application using React JS and JSX. It is kind of On the Job Training. One thing I noticed is, I get the same result for two different types of code. I would like to understand more about this. Can someone explain this, please?
Code Block one
{
this.state.entities.map((entity, index) => {
return <Link key={index} to={{ pathname: '/details/'}}>{entity.main_question}</Link>
})
}
Code Block two
{
this.state.entities.map((entity, index) => (
<Link key={index} to={{ pathname: '/details/' }}>{entity.main_question}</Link>
))
}