-
Notifications
You must be signed in to change notification settings - Fork 123
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
Fix issue 59 #60
Fix issue 59 #60
Conversation
src/__tests__/e2e.test.js
Outdated
@track({ event: 'buttonClick' }) | ||
handleClick = jest.fn(); | ||
render() { | ||
return <span onClick={this.handleClick}>Click Me</span>; |
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.
Linting is failing on this line, you can just // eslint-disable-line jsx-a11y/no-static-element-interactions
src/__tests__/e2e.test.js
Outdated
@@ -453,6 +453,7 @@ describe('e2e', () => { | |||
|
|||
@track({ page: 'Page' }) | |||
class Page extends React.Component { | |||
// eslint-disable-line jsx-a11y/no-static-element-interactions |
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.
Ah it would have to go on the line that's giving the error L460
. You can probably just disable this rule for the entire file, and put this at the top:
/* eslint-disable jsx-a11y/no-static-element-interactions */
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.
ah. fixed. thanks @tizmagik
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.
This is great, thanks @tanhauhau ! 🎉
#59
IMHO, you can either compute the tracking data lazily only when tracking is being called or eagerly whenever props changed.
Currently, the tracking data is being computed eagerly in the constructor, so for the minimal code change, i added the same computing call in the
componentWillReceiveProps