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

Fix issue 59 #60

Merged
merged 5 commits into from
Oct 17, 2017
Merged

Fix issue 59 #60

merged 5 commits into from
Oct 17, 2017

Conversation

tanhauhau
Copy link
Contributor

#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

@track({ event: 'buttonClick' })
handleClick = jest.fn();
render() {
return <span onClick={this.handleClick}>Click Me</span>;
Copy link
Collaborator

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

@@ -453,6 +453,7 @@ describe('e2e', () => {

@track({ page: 'Page' })
class Page extends React.Component {
// eslint-disable-line jsx-a11y/no-static-element-interactions
Copy link
Collaborator

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 */

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah. fixed. thanks @tizmagik

Copy link
Collaborator

@tizmagik tizmagik left a 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 ! 🎉

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.

2 participants