Airbnb style conflict?
comverser opened this issue · comments
Arrow functions are used for the TSX components in this boilerplate (e.g. Meta.tsx), but it is discouraged in Airbnb styles as shown below.
Could you please tell me why?
// bad
class Listing extends React.Component {
render() {
return <div>{this.props.hello}</div>;
}
}
// bad (relying on function name inference is discouraged)
const Listing = ({ hello }) => (
<div>{hello}</div>
);
// good
function Listing({ hello }) {
return <div>{hello}</div>;
}
The stackoverflow post is 6 years old and might not be relevant. Currently, it doesn't raise any ESLint error in the boilerplate.
The source of truth is ESLint.