1
1
import { default as Table , TableProps , ColumnType } from "antd/es/table" ;
2
- import { TableRowContext } from "./tableContext" ;
3
2
import { TableToolbar } from "./tableToolbarComp" ;
4
3
import { RowColorViewType , RowHeightViewType , TableEventOptionValues } from "./tableTypes" ;
5
4
import {
@@ -595,7 +594,6 @@ const TableCellView = React.memo((props: {
595
594
...restProps
596
595
} = props ;
597
596
598
- const rowContext = useContext ( TableRowContext ) ;
599
597
600
598
// Memoize style calculations
601
599
const style = useMemo ( ( ) => {
@@ -637,9 +635,6 @@ const TableCellView = React.memo((props: {
637
635
tdView = < td { ...restProps } > { children } </ td > ;
638
636
} else {
639
637
let { background } = style ! ;
640
- if ( rowContext . hover ) {
641
- background = 'transparent' ;
642
- }
643
638
644
639
tdView = (
645
640
< TableTd
@@ -663,29 +658,6 @@ const TableCellView = React.memo((props: {
663
658
return tdView ;
664
659
} ) ;
665
660
666
- const TableRowView = React . memo ( ( props : any ) => {
667
- const [ hover , setHover ] = useState ( false ) ;
668
- const [ selected , setSelected ] = useState ( false ) ;
669
-
670
- // Memoize event handlers
671
- const handleMouseEnter = useCallback ( ( ) => setHover ( true ) , [ ] ) ;
672
- const handleMouseLeave = useCallback ( ( ) => setHover ( false ) , [ ] ) ;
673
- const handleFocus = useCallback ( ( ) => setSelected ( true ) , [ ] ) ;
674
- const handleBlur = useCallback ( ( ) => setSelected ( false ) , [ ] ) ;
675
-
676
- return (
677
- < TableRowContext . Provider value = { { hover, selected } } >
678
- < tr
679
- { ...props }
680
- tabIndex = { - 1 }
681
- onMouseEnter = { handleMouseEnter }
682
- onMouseLeave = { handleMouseLeave }
683
- onFocus = { handleFocus }
684
- onBlur = { handleBlur }
685
- />
686
- </ TableRowContext . Provider >
687
- ) ;
688
- } ) ;
689
661
690
662
/**
691
663
* A table with adjustable column width, width less than 0 means auto column width
@@ -780,7 +752,6 @@ function ResizeableTableComp<RecordType extends object>(props: CustomTableProps<
780
752
} ,
781
753
body : {
782
754
cell : TableCellView ,
783
- row : TableRowView ,
784
755
} ,
785
756
} }
786
757
{ ...restProps }
0 commit comments