Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer-stateless-function with decorators #1034

captify-abogatyrov opened this issue Jan 20, 2017 · 2 comments

prefer-stateless-function with decorators #1034

captify-abogatyrov opened this issue Jan 20, 2017 · 2 comments


Copy link

captify-abogatyrov commented Jan 20, 2017

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

class ToDoList extends Component {
  render() {
    const { data } = this.props;
    return (
        {, i) => <SingleToDo

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

Copy link

ljharb commented Jan 20, 2017

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

benstepp added a commit to benstepp/eslint-plugin-react that referenced this issue Feb 23, 2017
Currently prefer-stateless-function warns when using a decorated class
over a stateless function. The decorator syntax only works with classes,
so it makes sense not to warn in this case.

Fixes jsx-eslint#1034
Copy link

OscarBarrett commented Apr 19, 2017

Could a new release be published that includes this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

No branches or pull requests

3 participants