How do I rewrite a react component with decorators as a pure function?
<p>I'm using the airbnb eslint settings, which have <a href="https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md" rel="noreferrer">a rule that enforces stateless react components to be rewritten as a pure function</a>. The following component triggers this rule, which means that the component below would be better written as a pure function:</p>

<pre><code>import React from 'react';
import { observer } from 'mobx-react';
import cssmodules from 'react-css-modules';

import styles from './index.css';
import Select from '../Select/';
import List from '../List/';

@cssmodules(styles)
@observer
export default class Analysis extends React.Component {
  render() {
    return (
      &lt;div styleName="wrapper"&gt;
        &lt;div styleName="column"&gt;
          &lt;Select store={this.props.store} /&gt;
        &lt;/div&gt;
        &lt;div styleName="column"&gt;
          &lt;List store={this.props.store} /&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    );
  }
}

Analysis.propTypes = {
  store: React.PropTypes.object.isRequired,
};
</code></pre>

<p>However, when I rewrite it as a pure function (see below), I get the error that <code>Leading decorators must be attached to a class declaration</code>:</p>

<pre><code>import React from 'react';
import { observer } from 'mobx-react';
import cssmodules from 'react-css-modules';

import styles from './index.css';
import Select from '../Select/';
import List from '../List/';

@cssmodules(styles)
@observer
function Analysis(props) {
  return (
    &lt;div styleName="wrapper"&gt;
      &lt;div styleName="column"&gt;
        &lt;Select store={props.store} /&gt;
      &lt;/div&gt;
      &lt;div styleName="column"&gt;
        &lt;List store={props.store} /&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  );
}

Analysis.propTypes = {
  store: React.PropTypes.object.isRequired,
};
</code></pre>

<p>So can I write it as a pure component and still attach the decorators? Or is this a mistake in the airbnb linting rules and is it impossible to satisfy both rules?</p>