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

Unnecessary binding #10

Open
sofiapoh opened this issue Jan 24, 2018 · 0 comments
Open

Unnecessary binding #10

sofiapoh opened this issue Jan 24, 2018 · 0 comments

Comments

@sofiapoh
Copy link

https://github.com/fac-12/Lex/blob/3f591db5c8a96556abc357c622929633afc5adf3/src/components/App.js#L54

and

https://github.com/fac-12/Lex/blob/3f591db5c8a96556abc357c622929633afc5adf3/src/components/App.js#L56

When the functions are defined with arrow function () => {} instead of using the function keyword they have access to the context in which they were defined. In this case this refers to the App class and no binding to the context outside is needed.

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

1 participant