From 8d50feb4ac4a5c31c8e099004ac2d4044b9129e5 Mon Sep 17 00:00:00 2001 From: snoop Date: Thu, 20 Jul 2017 18:14:40 +0900 Subject: [PATCH] this.state added --- .../@overflow/app/views/sensor/SensorList.tsx | 2 +- .../sensor/react/components/SensorList.tsx | 24 ++++++++----------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/ts/@overflow/app/views/sensor/SensorList.tsx b/src/ts/@overflow/app/views/sensor/SensorList.tsx index e0f4c5f..2197cf2 100644 --- a/src/ts/@overflow/app/views/sensor/SensorList.tsx +++ b/src/ts/@overflow/app/views/sensor/SensorList.tsx @@ -17,7 +17,7 @@ class SensorList extends React.Component, object> { public render(): JSX.Element { return ( - + ); } diff --git a/src/ts/@overflow/sensor/react/components/SensorList.tsx b/src/ts/@overflow/sensor/react/components/SensorList.tsx index c594645..e9a5d26 100644 --- a/src/ts/@overflow/sensor/react/components/SensorList.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorList.tsx @@ -14,28 +14,28 @@ export interface DispatchProps { onReadAllByTarget?(target: Target): void; } -export type Props = StateProps & DispatchProps; +export type SensorListProps = StateProps & DispatchProps; -export interface State { +export interface SensorListState { isDetail: boolean; selected: Sensor; } -export class SensorList extends React.Component { +export class SensorList extends React.Component { private data: any; - constructor(props: Props, context: State) { + constructor(props: SensorListProps, context: SensorListState) { super(props, context); - // this.state = { - // selected: null, - // isDetail: false, // temp - // }; + this.state = { + selected: null, + isDetail: false, // temp + }; } public componentWillMount(): void { - super.componentWillMount(); + // super.componentWillMount(); this.data = [ { 'id': '111', @@ -116,7 +116,7 @@ export class SensorList extends React.Component { public render(): JSX.Element { if (this.state.isDetail) { - return ; + return (); } return ( @@ -152,10 +152,6 @@ export class SensorList extends React.Component { ); } - - private onReadAllByTarget(): void { - console.log(''); - } }