Skip to content

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

Merged
merged 2 commits into from
Nov 1, 2019

Conversation

quininez
Copy link
Member

@quininez quininez commented Nov 1, 2019

add className to root components

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • My changes are less than 500 LOC
  • I have updated the documentation accordingly
  • I have read the README document
  • I have read the CONTRIBUTING document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • My commit message follows Conventional Commit Guideline

@quininez quininez requested a review from SeverS November 1, 2019 13:39
SeverS
SeverS previously approved these changes Nov 1, 2019
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
Copy link
Member

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

Copy link
Member

@kenshyx kenshyx Nov 1, 2019

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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

Copy link
Member

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

@quininez quininez merged commit 55764d2 into master Nov 1, 2019
@quininez quininez deleted the classnames branch November 1, 2019 16:45
josenriagu added a commit that referenced this pull request Sep 11, 2020
#200)

* chore(): add className to root components in design system, disable tslint jsx-no-lambda

* chore(): revert tslint rule
kenshyx pushed a commit that referenced this pull request Nov 30, 2021
#200)

* chore(): add className to root components in design system, disable tslint jsx-no-lambda

* chore(): revert tslint rule
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

Successfully merging this pull request may close these issues.

3 participants