已解决:Component should be written as a pure functioneslintreact/prefer-stateless-fun报错
已解决 Component should be written as a pure functioneslintreact/prefer-stateless-funComponent should be written as a pure functioneslintreact/prefer-stateless-fun解决方案:在class组件中添加state,即可constructor(props) {super(props)this.state = {}}...