Skip to content

Arrow function should not return assignment #948

@TaurusWood

Description

@TaurusWood

In my code if I write ref={arg => this.deleteBtn = arg}, the ESLint will show error;
<button type="button" className="btn btn-xs close" onClick={this.deleteTask} ref={arg => this.deleteBtn = arg} >
The ESLint : Arrow function should not return assignment.(no-return-assign)

So , If that is:
<button type="button" className="btn btn-xs close" onClick={this.deleteTask} ref={(arg) => { this.deleteBtn = arg; }} >

Then the ESLint has no error show

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions