@@ -7,8 +7,6 @@ import Tree from 'rc-tree';
7
7
import type { EventDataNode , ScrollTo } from 'rc-tree/lib/interface' ;
8
8
import type { FlattenDataNode , RawValueType , DataNode , TreeDataNode , Key } from './interface' ;
9
9
import { SelectContext } from './Context' ;
10
- import useKeyValueMapping from './hooks/useKeyValueMapping' ;
11
- import useKeyValueMap from './hooks/useKeyValueMap' ;
12
10
13
11
const HIDDEN_STYLE = {
14
12
width : 0 ,
@@ -91,6 +89,9 @@ const OptionList: React.RefForwardingComponent<
91
89
treeLoadedKeys,
92
90
treeMotion,
93
91
onTreeLoad,
92
+
93
+ getEntityByKey,
94
+ getEntityByValue,
94
95
} = React . useContext ( SelectContext ) ;
95
96
96
97
const treeRef = React . useRef < Tree > ( ) ;
@@ -101,9 +102,6 @@ const OptionList: React.RefForwardingComponent<
101
102
( prev , next ) => next [ 0 ] && prev [ 1 ] !== next [ 1 ] ,
102
103
) ;
103
104
104
- const [ cacheKeyMap , cacheValueMap ] = useKeyValueMap ( flattenOptions ) ;
105
- const [ getEntityByKey , getEntityByValue ] = useKeyValueMapping ( cacheKeyMap , cacheValueMap ) ;
106
-
107
105
// ========================== Values ==========================
108
106
const valueKeys = React . useMemo (
109
107
( ) =>
@@ -283,9 +281,8 @@ const OptionList: React.RefForwardingComponent<
283
281
) ;
284
282
} ;
285
283
286
- const RefOptionList = React . forwardRef < ReviseRefOptionListProps , OptionListProps < DataNode [ ] > > (
287
- OptionList ,
288
- ) ;
284
+ const RefOptionList =
285
+ React . forwardRef < ReviseRefOptionListProps , OptionListProps < DataNode [ ] > > ( OptionList ) ;
289
286
RefOptionList . displayName = 'OptionList' ;
290
287
291
288
export default RefOptionList ;
0 commit comments