react-panels: minor progress on data flow

This commit is contained in:
Torkel Ödegaard
2018-07-05 13:10:39 -07:00
parent 447bc3a6e0
commit c86fc6fb47
5 changed files with 84 additions and 40 deletions

View File

@@ -1,12 +1,20 @@
import React from 'react';
import React, { PureComponent } from 'react';
import { PanelProps } from 'app/features/dashboard/dashgrid/DataPanel';
export class ReactTestPanel extends React.Component<any, any> {
export class ReactTestPanel extends PureComponent<PanelProps> {
constructor(props) {
super(props);
}
render() {
return <h2>I am a react panel, haha!</h2>;
const { data } = this.props;
let value = 0;
if (data.length) {
value = data[0].value;
}
return <h2>I am a react value: {value}</h2>;
}
}