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

ngOnChanges is called even if no inputs are set #323

Closed
antischematic opened this issue Nov 20, 2022 · 3 comments
Closed

ngOnChanges is called even if no inputs are set #323

antischematic opened this issue Nov 20, 2022 · 3 comments

Comments

@antischematic
Copy link

antischematic commented Nov 20, 2022

@Component({ template: `` })
class Counter {
  ngOnChanges() {
    throw new Error("should not be called")
  }
}

await render(Counter)

Expected: nothing
Actual: Error thrown

It should only call ngOnChanges if inputs are overridden.

@timdeschryver
Copy link
Member

Good catch, thanks!

timdeschryver added a commit that referenced this issue Nov 22, 2022
Closes #323

BREAKING CHANGE:

This change is made to have the same behavior as the run time behavior.

BEFORE:

The `ngOnChanges` lifecycle is always invoked when a component is rendered. 

AFTER:

The `ngOnChanges` lifecycle is only invoked if a component is rendered with `componentProperties`.
@github-actions
Copy link

🎉 This issue has been resolved in version 13.0.0-beta.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

timdeschryver added a commit that referenced this issue Dec 8, 2022
Closes #323

BREAKING CHANGE:

This change is made to have the same behavior as the run time behavior.

BEFORE:

The `ngOnChanges` lifecycle is always invoked when a component is rendered. 

AFTER:

The `ngOnChanges` lifecycle is only invoked if a component is rendered with `componentProperties`.
@github-actions
Copy link

🎉 This issue has been resolved in version 13.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants