Skip to content

Commit edab4bd

Browse files
authored
chore: add NODE_ENV to OptionList.displayName (#448)
1 parent d74250c commit edab4bd

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/OptionList.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
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';
51
import { useBaseProps } from 'rc-select';
2+
import type { RefOptionListProps } from 'rc-select/lib/OptionList';
63
import type { TreeProps } from 'rc-tree';
74
import Tree from 'rc-tree';
85
import 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';
109
import LegacyContext from './LegacyContext';
1110
import TreeSelectContext from './TreeSelectContext';
11+
import type { Key, TreeDataNode } from './interface';
1212
import { getAllKeys, isCheckDisabled } from './utils/valueUtil';
1313

1414
const HIDDEN_STYLE = {
@@ -30,7 +30,7 @@ interface TreeEventInfo {
3030

3131
type 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

260260
const RefOptionList = React.forwardRef<ReviseRefOptionListProps>(OptionList);
261-
RefOptionList.displayName = 'OptionList';
261+
262+
if (process.env.NODE_ENV !== 'production') {
263+
RefOptionList.displayName = 'OptionList';
264+
}
262265

263266
export default RefOptionList;

0 commit comments

Comments
 (0)