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

New rule: no-bind #44

Closed
huashiyiqike opened this issue Dec 11, 2016 · 3 comments
Closed

New rule: no-bind #44

huashiyiqike opened this issue Dec 11, 2016 · 3 comments

Comments

@huashiyiqike
Copy link

huashiyiqike commented Dec 11, 2016

To circumvent re-rendering by creating a new function each time when binding this to functions

https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md

"jsx-no-bind": [<enabled>, {
  "ignoreRefs": <boolean> || false,
  "allowArrowFunctions": <boolean> || false,
  "allowBind": <boolean> || false
}]
@tp
Copy link

tp commented Dec 11, 2016

I found that the performance impact may not even be the real issue this would be helpful with, but rather TypeScript's lenient typing of bind (bind(this: Function, thisArg: any, ...argArray: any[]): any;), which results in parameter-mismatches not being caught.

@huashiyiqike
Copy link
Author

@tp Great point! I didn't notice that, here is the link https://basarat.gitbooks.io/typescript/content/docs/tips/bind.html

@huashiyiqike huashiyiqike changed the title add support for tsx-no-bind? New rule: add support for tsx-no-bind? Dec 16, 2016
@huashiyiqike huashiyiqike changed the title New rule: add support for tsx-no-bind? New rule: tsx-no-bind Dec 16, 2016
@huashiyiqike huashiyiqike changed the title New rule: tsx-no-bind New rule: no-bind Dec 16, 2016
@adidahiya
Copy link
Contributor

will be available in v2.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants