Suppose we have a function using ES6 syntax like this:
const AccountOverview = (props) => {
const overviewVisible = props.overviewVisible;
const accountNumber = props.accountNumber;
const toggleAccountOverview = props.toggleAccountOverview;
const onClick = (e) => {
e.preventDefault();
toggleAccountOverview(!overviewVisible, accountNumber);
};
// FIXME: eslint WHY??????
/* eslint-disable */
return (
<div
className={props.overviewVisible ? 'acc-block open' : 'acc-block'}
>
<div>
)
}
and a function like this:
const AccountDetails = props => (
<div className="tabInner">
</div>
)
Why the first function is declared using {} and the second function is declared using just ()?