mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
react-panels: minor progress on data flow
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user