Skip to content

Commit 09a6e57

Browse files
committed
perf: uninstall classnames, install clsx
1 parent 29ef53f commit 09a6e57

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/BaseSelect/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { AlignType, BuildInPlacements } from '@rc-component/trigger/lib/interface';
2-
import cls from 'classnames';
2+
import { clsx } from 'clsx';
33
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
44
import useControlledState from '@rc-component/util/lib/hooks/useControlledState';
55
import isMobile from '@rc-component/util/lib/isMobile';
@@ -732,7 +732,7 @@ const BaseSelect = React.forwardRef<BaseSelectRef, BaseSelectProps>((props, ref)
732732
if (showSuffixIcon) {
733733
arrowNode = (
734734
<TransBtn
735-
className={cls(`${prefixCls}-arrow`, classNames?.suffix, {
735+
className={clsx(`${prefixCls}-arrow`, classNames?.suffix, {
736736
[`${prefixCls}-arrow-loading`]: loading,
737737
})}
738738
style={styles?.suffix}
@@ -776,7 +776,7 @@ const BaseSelect = React.forwardRef<BaseSelectRef, BaseSelectProps>((props, ref)
776776
const optionList = <OptionList ref={listRef} />;
777777

778778
// ============================= Select =============================
779-
const mergedClassName = cls(prefixCls, className, {
779+
const mergedClassName = clsx(prefixCls, className, {
780780
[`${prefixCls}-focused`]: mockFocused,
781781
[`${prefixCls}-multiple`]: multiple,
782782
[`${prefixCls}-single`]: !multiple,

src/Selector/Input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import classNames from 'classnames';
2+
import { clsx } from 'clsx';
33
import { composeRef } from '@rc-component/util/lib/ref';
44
import { warning } from '@rc-component/util/lib/warning';
55
import composeProps from '@rc-component/util/lib/composeProps';
@@ -70,7 +70,7 @@ const Input: React.ForwardRefRenderFunction<InputRef, InputProps> = (props, ref)
7070
ref: composeRef(ref, originRef as any),
7171
autoComplete: autoComplete || 'off',
7272

73-
className: classNames(
73+
className: clsx(
7474
`${prefixCls}-selection-search-input`,
7575
originProps.className,
7676
contextClassNames?.input,

0 commit comments

Comments
 (0)