Skip to content

Commit fdde836

Browse files
committed
fix: empty data
1 parent 3071e5d commit fdde836

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/components/QueryResultTable/QueryResultTable.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const prepareTypedColumns = (columns: ColumnType[], data?: KeyValueRow[]) => {
4949
});
5050
};
5151

52-
const prepareGenericColumns = (data: KeyValueRow[]) => {
53-
if (!data.length) {
52+
const prepareGenericColumns = (data?: KeyValueRow[]) => {
53+
if (!data?.length) {
5454
return [];
5555
}
5656

@@ -83,9 +83,6 @@ export const QueryResultTable = (props: QueryResultTableProps) => {
8383
const {columns: rawColumns, data, ...restProps} = props;
8484

8585
const columns = React.useMemo(() => {
86-
if (!data?.length) {
87-
return [];
88-
}
8986
return rawColumns ? prepareTypedColumns(rawColumns, data) : prepareGenericColumns(data);
9087
}, [data, rawColumns]);
9188

0 commit comments

Comments
 (0)