File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
packages/module/src/DataViewTable Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,16 @@ export const isDataViewTrObject = (value: DataViewTr): value is { row: DataViewT
2222// Tree table typings
2323export interface DataViewTrTree extends DataViewTrObject { id : string , children ?: DataViewTrTree [ ] }
2424
25- export type DataViewTableProps = DataViewTableBasicProps | DataViewTableTreeProps ;
25+ export type DataViewTableProps =
26+ | ( {
27+ isTreeTable : true ;
28+ } & DataViewTableTreeProps )
29+ | ( {
30+ isTreeTable ?: false ;
31+ } & DataViewTableBasicProps ) ;
2632
27- export const DataViewTable : React . FC < DataViewTableProps > = ( { isTreeTable , ... props } : DataViewTableProps ) => (
28- isTreeTable ? ( < DataViewTableTree { ...( props as DataViewTableTreeProps ) } /> ) : ( < DataViewTableBasic { ...( props as DataViewTableBasicProps ) } /> )
33+ export const DataViewTable : React . FC < DataViewTableProps > = ( props ) => (
34+ props . isTreeTable ? < DataViewTableTree { ...props } /> : < DataViewTableBasic { ...props } />
2935) ;
3036
3137export default DataViewTable ;
You can’t perform that action at this time.
0 commit comments