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

jsx-no-lambda: allow lambdas on ref attribute #107

Merged
merged 1 commit into from
Jul 18, 2017

Conversation

testerez
Copy link
Contributor

@testerez testerez commented Jul 15, 2017

Fixes issue #26

The main performance drop with arrow function as prop is due to pure components re-rendering when it could be avoided. The creation of a new function is not a real problem.

The ref attribute is not part of the props so it's ok to use an arrow function here.

See: facebook/react#9086 (comment)

Rather than adding a configuration, I simply ignore "ref" attribute. I think that this is what makes the more sense in most situations.

@palantirtech
Copy link
Member

Thanks for your interest in palantir/tslint-react, @testerez! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

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

thanks @testerez

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.

None yet

3 participants