📜  组件应该写成纯函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:28.736000             🧑  作者: Mango

代码示例1
// Add constructor() like:
exports class myComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  render() {
    return (
      
Hello
); } }