@@ -5,13 +5,10 @@ import cs from 'clsx';
55/** @jsx jsx */
66import { css , jsx } from '@emotion/react' ;
77
8- import { RowContainer } from '@table-library/react-table-library/common/components/Row' ;
98import { isRowClick } from '@table-library/react-table-library/common/util/isRowClick' ;
9+ import { RowContainer } from '@table-library/react-table-library/common/components/Row' ;
1010import { ThemeContext } from '@table-library/react-table-library/common/context/Theme' ;
11- import { SelectContext } from '@table-library/react-table-library/common/context/Select' ;
12- import { TreeContext } from '@table-library/react-table-library/common/context/Tree' ;
13- import { SortContext } from '@table-library/react-table-library/common/context/Sort' ;
14- import { PaginationContext } from '@table-library/react-table-library/common/context/Pagination' ;
11+ import { useFeatures } from '@table-library/react-table-library/common/context/Feature' ;
1512
1613import { useConsumeRowLayout } from '@table-library/react-table-library/resize/useConsumeRowLayout' ;
1714
@@ -77,19 +74,7 @@ const evaluateProps = (rowPropsByFeature: FeatureProps[], onSingleClick: OnClick
7774export const Row : React . FC < RowProps > = ( props : RowProps ) => {
7875 const { item, className, disabled, onClick, onDoubleClick, children, ...rest } = props ;
7976
80- const select = React . useContext ( SelectContext ) ;
81- const tree = React . useContext ( TreeContext ) ;
82- const sort = React . useContext ( SortContext ) ;
83- const pagination = React . useContext ( PaginationContext ) ;
84-
85- const features = {
86- select,
87- tree,
88- sort,
89- pagination,
90- // others
91- } ;
92-
77+ const features = useFeatures ( ) ;
9378 const rowPropsByFeature = getRowProps ( features , props ) ;
9479
9580 const theme = React . useContext ( ThemeContext ) ;
0 commit comments