-
Notifications
You must be signed in to change notification settings - Fork 16
chore(): add className to root components in design system, disable t… #200
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
Conversation
…slint jsx-no-lambda
tslint.json
Outdated
@@ -15,7 +15,8 @@ | |||
"only-arrow-functions": false, | |||
"prettier": true, | |||
"react-hooks-nesting": "error", | |||
"import-name": false | |||
"import-name": false, | |||
"jsx-no-lambda:": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep this for better error tracing and also you don't create a new function each time the element gets rendered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also
Creating new anonymous functions (with either the function syntax or ES2015 arrow syntax) inside the render call stack works against pure component rendering. When doing an equality check between two lambdas, React will always consider them unequal values and force the component to re-render more often than necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for passing props to a handler in a loop there is no solution that is more efficient, but only for that use case I could disable that rule on that line only, and keep it as a general rule true
discussion about it here:
palantir/tslint-react#96
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, use disable next-line if there is no other option but keep it on as a general rule :D
#200) * chore(): add className to root components in design system, disable tslint jsx-no-lambda * chore(): revert tslint rule
#200) * chore(): add className to root components in design system, disable tslint jsx-no-lambda * chore(): revert tslint rule
add className to root components
Types of changes
Checklist