I'm new to React and now I'm taking a course on Pluralsight.
Let's take this example:
const Card = (props) => {
var profile = props;
return (<div className="github-profile">
<img src={profile.avatar_url} />
<div className="info">
<div className="name">{profile.name}</div>
<div className="company">{profile.company}</div>
</div>
</div>);
};
This is a function component but this can be rewrite like:
const Card = (props) => (
<div className="github-profile">
<img src={props.avatar_url} />
<div className="info">
<div className="name">{props.name}</div>
<div className="company">{props.company}</div>
</div>
</div>
);
What is the actual difference? Aren't the same thing? When you use () and when {}?