Skip to content

Commit

Permalink
fix: removing baselement remount (#2579)
Browse files Browse the repository at this point in the history
  • Loading branch information
ribeiroguilherme authored Feb 28, 2024
1 parent 623cdeb commit 0d06766
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
17 changes: 0 additions & 17 deletions packages/lib/src/components/internal/BaseElement/BaseElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,23 +169,6 @@ class BaseElement<P extends BaseElementProps> implements IBaseElement {
return this.unmount().mount(this._node); // for new mount fny
}

/**
* Unmounts an element and mounts it again on the same node i.e. allows mount w/o having to pass a node.
* Should be "private" & undocumented (although being a public function is useful for testing).
* Left in for legacy reasons
*/
public remount(component?): this {
if (!this._node) {
throw new Error('Component is not mounted.');
}

const newComponent = component || this.render();

render(newComponent, this._node, null);

return this;
}

/**
* Unmounts a payment element from the DOM
*/
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/components/internal/BaseElement/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface IBaseElement {
render(): ComponentChild | Error;
mount(domNode: HTMLElement | string): IBaseElement;
update(props): IBaseElement;
remount(component): IBaseElement;
unmount(): IBaseElement;
remove(): void;
}

0 comments on commit 0d06766

Please sign in to comment.