From 475ef66c58258468165d26f927735978dda3a4af Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Fri, 3 Sep 2021 10:25:45 +0100 Subject: [PATCH] Fix state initialisation for DevicesPanel --- src/components/views/settings/DevicesPanel.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/DevicesPanel.tsx b/src/components/views/settings/DevicesPanel.tsx index 5e297bbea6..9a1321619e 100644 --- a/src/components/views/settings/DevicesPanel.tsx +++ b/src/components/views/settings/DevicesPanel.tsx @@ -35,7 +35,7 @@ interface IProps { interface IState { devices: IMyDevice[]; deviceLoadError?: string; - selectedDevices?: string[]; + selectedDevices: string[]; deleting?: boolean; } @@ -43,6 +43,14 @@ interface IState { export default class DevicesPanel extends React.Component { private unmounted = false; + constructor(props: IProps) { + super(props); + this.state = { + devices: [], + selectedDevices: [], + }; + } + public componentDidMount(): void { this.loadDevices(); }