阅读背景:

为什么Airbnb风格指南表示不鼓励依赖功能名称推断?

来源:互联网 
// 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>;
}
// bad
class Listing extends React.Component {



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: