Skip to content

Commit

Permalink
chore: add NODE_ENV to OptionList.displayName (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jia-nan authored Dec 26, 2023
1 parent d74250c commit edab4bd
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/OptionList.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as React from 'react';
import KeyCode from 'rc-util/lib/KeyCode';
import useMemo from 'rc-util/lib/hooks/useMemo';
import type { RefOptionListProps } from 'rc-select/lib/OptionList';
import { useBaseProps } from 'rc-select';
import type { RefOptionListProps } from 'rc-select/lib/OptionList';
import type { TreeProps } from 'rc-tree';
import Tree from 'rc-tree';
import type { EventDataNode, ScrollTo } from 'rc-tree/lib/interface';
import type { TreeDataNode, Key } from './interface';
import KeyCode from 'rc-util/lib/KeyCode';
import useMemo from 'rc-util/lib/hooks/useMemo';
import * as React from 'react';
import LegacyContext from './LegacyContext';
import TreeSelectContext from './TreeSelectContext';
import type { Key, TreeDataNode } from './interface';
import { getAllKeys, isCheckDisabled } from './utils/valueUtil';

const HIDDEN_STYLE = {
Expand All @@ -30,7 +30,7 @@ interface TreeEventInfo {

type ReviseRefOptionListProps = Omit<RefOptionListProps, 'scrollTo'> & { scrollTo: ScrollTo };

const OptionList: React.RefForwardingComponent<ReviseRefOptionListProps> = (_, ref) => {
const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_, ref) => {
const { prefixCls, multiple, searchValue, toggleOpen, open, notFoundContent } = useBaseProps();

const {
Expand Down Expand Up @@ -258,6 +258,9 @@ const OptionList: React.RefForwardingComponent<ReviseRefOptionListProps> = (_, r
};

const RefOptionList = React.forwardRef<ReviseRefOptionListProps>(OptionList);
RefOptionList.displayName = 'OptionList';

if (process.env.NODE_ENV !== 'production') {
RefOptionList.displayName = 'OptionList';
}

export default RefOptionList;

1 comment on commit edab4bd

@vercel
Copy link

@vercel vercel bot commented on edab4bd Dec 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.