Skip to content

Commit

Permalink
Merge pull request #20492 from emberjs/types/component-init
Browse files Browse the repository at this point in the history
[BUGFIX stable] EmberComponent init can have no args
  • Loading branch information
chriskrycho authored Jun 29, 2023
2 parents f7f6c50 + 386dcc2 commit ed65954
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@ember/-internals/glimmer/lib/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ class Component<S = unknown>
declare [IS_DISPATCHING_ATTRS]: boolean;
declare [DIRTY_TAG]: DirtyableTag;

init(properties: object | undefined) {
init(properties?: object | undefined) {
super.init(properties);

// Handle methods from ViewMixin.
Expand Down
4 changes: 4 additions & 0 deletions type-tests/@ember/component-test/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const component1 = Component.extend({
class AnotherComponent extends Component {
name = '';

init() {
super.init();
}

hello(name: string) {
this.set('name', name);
this.name = name;
Expand Down

0 comments on commit ed65954

Please sign in to comment.