mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-21 16:57:09 +00:00
🔧 Remove unnecessary re-renders (#3014)
* 🔧 Remove unnecessary re-renders
* address review comments
* address review comments
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
customElement,
|
||||
css,
|
||||
CSSResult,
|
||||
PropertyValues,
|
||||
} from "lit-element";
|
||||
|
||||
import "../components/hui-generic-entity-row";
|
||||
@@ -16,6 +17,7 @@ import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
||||
import { EntityRow, EntityConfig } from "./types";
|
||||
import { HomeAssistant } from "../../../types";
|
||||
import { setValue } from "../../../data/input_text";
|
||||
import { hasConfigOrEntityChanged } from "../common/has-changed";
|
||||
|
||||
@customElement("hui-input-number-entity-row")
|
||||
class HuiInputNumberEntityRow extends LitElement implements EntityRow {
|
||||
@@ -48,6 +50,10 @@ class HuiInputNumberEntityRow extends LitElement implements EntityRow {
|
||||
}
|
||||
}
|
||||
|
||||
protected shouldUpdate(changedProps: PropertyValues): boolean {
|
||||
return hasConfigOrEntityChanged(this, changedProps);
|
||||
}
|
||||
|
||||
protected render(): TemplateResult | void {
|
||||
if (!this._config || !this.hass) {
|
||||
return html``;
|
||||
|
||||
Reference in New Issue
Block a user