Skip to content

Commit d0a4e3e

Browse files
Copilothotlong
andcommitted
Replace React.createElement with JSX syntax
Address code review feedback to use JSX instead of verbose React.createElement() Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 37a7aa6 commit d0a4e3e

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

packages/plugin-dashboard/src/ReportRenderer.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const ReportRenderer: React.FC<ReportRendererProps> = ({ schema }) => {
3838
const ChartComponent = ComponentRegistry.get(chartType);
3939
return ChartComponent ? (
4040
<div className="min-h-[300px] border rounded-md p-4 bg-white/50">
41-
{React.createElement(ChartComponent, { schema: { ...schema.chart, data } })}
41+
<ChartComponent schema={{ ...schema.chart, data }} />
4242
</div>
4343
) : null;
4444
})()}
@@ -49,14 +49,14 @@ export const ReportRenderer: React.FC<ReportRendererProps> = ({ schema }) => {
4949
{(() => {
5050
const GridComponent = showGrid ? (ComponentRegistry.get('aggrid') || ComponentRegistry.get('table')) : null;
5151
return GridComponent ? (
52-
React.createElement(GridComponent, {
53-
schema: {
54-
type: 'aggrid',
55-
rowData: data,
56-
columnDefs: columns,
57-
domLayout: 'autoHeight'
58-
}
59-
})
52+
<GridComponent
53+
schema={{
54+
type: 'aggrid',
55+
rowData: data,
56+
columnDefs: columns,
57+
domLayout: 'autoHeight'
58+
}}
59+
/>
6060
) : (
6161
// Simple Fallback Table if Grid plugin missing
6262
<div className="overflow-x-auto">

0 commit comments

Comments
 (0)