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

ComponentProperties no longer in ngOnChanges #188

Closed
swhammack opened this issue Mar 17, 2021 · 5 comments · Fixed by #189
Closed

ComponentProperties no longer in ngOnChanges #188

swhammack opened this issue Mar 17, 2021 · 5 comments · Fixed by #189
Labels

Comments

@swhammack
Copy link

After updating to 10.4.0 we saw a bunch of tests that were suddenly failing. After a bit of digging I realized each component implemented OnChanges and in the ngOnChanges() function we were looking for an @Input property to be in the changes object. It seems with the latest changes any @Input property that is set in componentProperties is never in the changes object in ngOnChanges.

Quick example:

@Component
class Component implements OnChanges {
  @Input() someProperty: string

  ngOnChanges(changes: SimpleChanges) {
    if(changes.someProperty) {
      // Do something if @Input property changed
    }
  }
}
render(Component, {
  componentProperties: {someProperty: 'value'}
})
@timdeschryver
Copy link
Member

Thanks for the report!
Could you create a reproduction for this behavior, or take a look at how we can fix this in ATL?
I thought we had a test case for this, but it seems like it isn't covering everything 😅

@swhammack
Copy link
Author

swhammack commented Mar 18, 2021

Here is my fork with a reproduction test.

@timdeschryver
Copy link
Member

Thanks a lot @swhammack !

@github-actions
Copy link

🎉 This issue has been resolved in version 10.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@swhammack
Copy link
Author

@timdeschryver thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants