sadpandajoe commented on code in PR #44208:
URL: https://github.com/apache/superset/pull/44208#discussion_r4075839971
##########
superset-frontend/packages/superset-ui-core/src/components/TableCollection/TableCollection.stories.tsx:
##########
@@ -25,20 +25,20 @@ import {
Row,
SortingRule,
HeaderGroup,
- ColumnInstance,
TablePropGetter,
TableBodyPropGetter,
} from 'react-table';
-import TableCollection from '.';
+import TableCollection, { type ListViewColumn } from '.';
import { TableSize } from '../Table';
-// Type aliases for casting to the component's expected object-based types
-// Required because memo() loses the generic type parameter
+// Type aliases for casting to the component's expected object-based types,
+// since these stories' own useTable() calls are generic over plain `object`
+// rather than a concrete row type.
type AnyProps = TablePropGetter<object>;
type AnyBodyProps = TableBodyPropGetter<object>;
type AnyHeaders = HeaderGroup<object>[];
type AnyRows = Row<object>[];
-type AnyColumns = ColumnInstance<object>[];
+type AnyColumns = ListViewColumn<object>[];
Review Comment:
This new alias makes `useTable(...).columns` incompatible with
`TableCollection`, so the story's `as AnyColumns` casts now hide the same
TS2322 that consumers following the former public prop contract will get.
Should this accept the generated react-table column shape as well, rather than
requiring those callers to cast?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]