Eslint-plugin-react: prefer-stateless-function with decorators

Created on 20 Jan 2017  路  2Comments  路  Source: yannickcr/eslint-plugin-react

i am using decorators, decorators work just with class so i must not use stateless function

@dragDropContext(HTML5Backend)
class ToDoList extends Component {
  render() {
    const { data } = this.props;
    return (
      <div>
        {data.map(((todo, i) => <SingleToDo
          data={todo}
        />))}
      </div>
    );
  }
}

and in this case i have error prefer-stateless-function

bug help wanted

Most helpful comment

Could a new release be published that includes this please?

All 2 comments

It makes sense that a decorated class should not be reported here.

Could a new release be published that includes this please?

Was this page helpful?
0 / 5 - 0 ratings