Linter complains when using arrow function for refs
See original GitHub issueI’m using arrow function for refs as explained in the docs here: https://facebook.github.io/react/docs/more-about-refs.html
but the linter complains with this:
217:54 warning Arrow function should not return assignment
Is there an issue with the way the docs describe how to use arrow functions with refs? Should the docs be updated?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Arrow function should not return assignment? - Stack Overflow
My code is working correctly in the app however, my eslint isn't liking it and is saying I should not return assignment. What...
Read more >arrow-body-style - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Common React TypeScript ESLint / Lint Errors & Warning ...
The lint messages: Arrow function should not return assignment warning. In case we want to return an assignment but our code is using...
Read more >ESLint v2.0.0-rc.1 released - ESLint中文文档
There was an additional condition that had been part of no-arrow-condition incorrectly, which checked for the use of arrow functions in conditional ...
Read more >@sailshq/eslint | Yarn - Package Manager
An AST-based pattern checker for JavaScript. ast, lint, javascript, ecmascript. readme. @sailshq/eslint. A fork of eslint v4.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are probably writing
if you add
{}
around the function body it should remove the warning:Fixed via #529, will be out in the next version. Thanks!