1- import * as React from 'react' ;
2- import KeyCode from 'rc-util/lib/KeyCode' ;
3- import useMemo from 'rc-util/lib/hooks/useMemo' ;
4- import type { RefOptionListProps } from 'rc-select/lib/OptionList' ;
51import { useBaseProps } from 'rc-select' ;
2+ import type { RefOptionListProps } from 'rc-select/lib/OptionList' ;
63import type { TreeProps } from 'rc-tree' ;
74import Tree from 'rc-tree' ;
85import type { EventDataNode , ScrollTo } from 'rc-tree/lib/interface' ;
9- import type { TreeDataNode , Key } from './interface' ;
6+ import KeyCode from 'rc-util/lib/KeyCode' ;
7+ import useMemo from 'rc-util/lib/hooks/useMemo' ;
8+ import * as React from 'react' ;
109import LegacyContext from './LegacyContext' ;
1110import TreeSelectContext from './TreeSelectContext' ;
11+ import type { Key , TreeDataNode } from './interface' ;
1212import { getAllKeys , isCheckDisabled } from './utils/valueUtil' ;
1313
1414const HIDDEN_STYLE = {
@@ -30,7 +30,7 @@ interface TreeEventInfo {
3030
3131type ReviseRefOptionListProps = Omit < RefOptionListProps , 'scrollTo' > & { scrollTo : ScrollTo } ;
3232
33- const OptionList : React . RefForwardingComponent < ReviseRefOptionListProps > = ( _ , ref ) => {
33+ const OptionList : React . ForwardRefRenderFunction < ReviseRefOptionListProps > = ( _ , ref ) => {
3434 const { prefixCls, multiple, searchValue, toggleOpen, open, notFoundContent } = useBaseProps ( ) ;
3535
3636 const {
@@ -258,6 +258,9 @@ const OptionList: React.RefForwardingComponent<ReviseRefOptionListProps> = (_, r
258258} ;
259259
260260const RefOptionList = React . forwardRef < ReviseRefOptionListProps > ( OptionList ) ;
261- RefOptionList . displayName = 'OptionList' ;
261+
262+ if ( process . env . NODE_ENV !== 'production' ) {
263+ RefOptionList . displayName = 'OptionList' ;
264+ }
262265
263266export default RefOptionList ;
0 commit comments