Skip to content

Commit 02d4a65

Browse files
ref(components); convert StackedAreaChart from class to function component
1 parent 14bac4a commit 02d4a65

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import {Component} from 'react';
2-
31
import type {AreaChartProps} from 'sentry/components/charts/areaChart';
42
import {AreaChart} from 'sentry/components/charts/areaChart';
53

6-
class StackedAreaChart extends Component<AreaChartProps> {
7-
render() {
8-
return <AreaChart tooltip={{filter: val => val > 0}} {...this.props} stacked />;
9-
}
4+
function StackedAreaChart(props: AreaChartProps) {
5+
return <AreaChart tooltip={{filter: val => val > 0}} {...props} stacked />;
106
}
117

128
export default StackedAreaChart;

static/app/views/releases/detail/overview/releaseComparisonChart/releaseSessionsChart.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ class ReleaseSessionsChart extends Component<Props> {
124124
}
125125
}
126126

127-
getChart():
128-
| React.ComponentType<StackedAreaChart['props']>
129-
| React.ComponentType<AreaChartProps> {
127+
getChart(): React.ComponentType<AreaChartProps> {
130128
const {chartType} = this.props;
131129
switch (chartType) {
132130
case ReleaseComparisonChartType.CRASH_FREE_SESSIONS:

0 commit comments

Comments
 (0)