react/no-set-state 风格 
其作用 
禁止在 React 组件中使用 this.setState。
为什么这样做不好? 
当使用将应用程序状态与 UI 组件分开的架构(如 Flux)时,禁止使用局部组件状态可能更可取。此规则在只读应用程序(不使用表单)中尤其有用,因为在这种情况下,局部组件状态几乎没有必要。
示例 
jsx
var Hello = createReactClass({
  getInitialState: function () {
    return {
      name: this.props.name,
    };
  },
  handleClick: function () {
    this.setState({
      name: this.props.name.toUpperCase(),
    });
  },
  render: function () {
    return <div onClick={this.handleClick.bind(this)}>Hello {this.state.name}</div>;
  },
});