From 0d067661914da1ec044a79d78f5b645b09e9c788 Mon Sep 17 00:00:00 2001 From: Guilherme Ribeiro Date: Wed, 28 Feb 2024 10:17:31 -0300 Subject: [PATCH] fix: removing baselement remount (#2579) --- .../internal/BaseElement/BaseElement.ts | 17 ----------------- .../components/internal/BaseElement/types.ts | 1 - 2 files changed, 18 deletions(-) diff --git a/packages/lib/src/components/internal/BaseElement/BaseElement.ts b/packages/lib/src/components/internal/BaseElement/BaseElement.ts index 5ec12f436e..7072f0a6b2 100644 --- a/packages/lib/src/components/internal/BaseElement/BaseElement.ts +++ b/packages/lib/src/components/internal/BaseElement/BaseElement.ts @@ -169,23 +169,6 @@ class BaseElement

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 */ diff --git a/packages/lib/src/components/internal/BaseElement/types.ts b/packages/lib/src/components/internal/BaseElement/types.ts index 170f9398b5..c8dff750c1 100644 --- a/packages/lib/src/components/internal/BaseElement/types.ts +++ b/packages/lib/src/components/internal/BaseElement/types.ts @@ -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; }