diff --git a/lib/core/src/react/components/html-content.tsx b/lib/core/src/react/components/html-content.tsx index db63285b0a..6e414dcb8f 100644 --- a/lib/core/src/react/components/html-content.tsx +++ b/lib/core/src/react/components/html-content.tsx @@ -17,35 +17,25 @@ import type {HtmlContentProps} from '../types'; export class HtmlContent extends Component { protected _ref = createRef(); - update() { - const element = this._ref.current; - if (!element) { + protected _runJS() { + if (!this.props.executeScript) { return; } - (this.props.htmlRender || HtmlContent.update)(element, this.props); + $(this._ref.current).runJS().zuiInit(); } componentDidMount(): void { - this.update(); + this._runJS(); } componentDidUpdate(previousProps: Readonly): void { if (this.props.html !== previousProps.html) { - this.update(); + this._runJS(); } } render(props: HtmlContentProps) { const {executeScript, html, ...others} = props; - return ; - } - - static update(element: HTMLElement, props: HtmlContentProps) { - const {executeScript, html} = props; - if (executeScript) { - $(element).html(html); - } else { - element.innerHTML = html; - } + return ; } } diff --git a/lib/core/src/react/types/html-content-props.ts b/lib/core/src/react/types/html-content-props.ts index 5821e495ef..c71e6e215a 100644 --- a/lib/core/src/react/types/html-content-props.ts +++ b/lib/core/src/react/types/html-content-props.ts @@ -13,9 +13,4 @@ export interface HtmlContentProps extends HElementProps { * Execute script. */ executeScript?: boolean, - - /** - * Element inner html updater. - */ - htmlRender?: (element: HTMLElement, props: HtmlContentProps) => void, }