Skip to content

Commit 36c9370

Browse files
committed
perf: uninstall classnames, install clsx
1 parent 0abeae2 commit 36c9370

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ lib
2727
es
2828
yarn.lock
2929
package-lock.json
30+
pnpm-lock.yaml
3031
coverage/
3132
.doc
3233
# umi

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@
4343
"coverage": "rc-test --coverage"
4444
},
4545
"dependencies": {
46-
"classnames": "^2.2.1",
4746
"@rc-component/input": "~1.1.0",
4847
"@rc-component/resize-observer": "^1.0.0",
49-
"@rc-component/util": "^1.3.0"
48+
"@rc-component/util": "^1.3.0",
49+
"clsx": "^2.1.1"
5050
},
5151
"devDependencies": {
5252
"@rc-component/father-plugin": "^2.0.2",
5353
"@rc-component/np": "^1.0.3",
5454
"@testing-library/jest-dom": "^5.16.5",
5555
"@testing-library/react": "^15.0.0",
56-
"@types/classnames": "^2.2.9",
56+
"@types/node": "^24.5.2",
5757
"@types/react": "^18.0.0",
5858
"@types/react-dom": "^18.0.0",
5959
"@umijs/fabric": "^2.0.8",

src/ResizableTextArea.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ResizeObserver from '@rc-component/resize-observer';
22
import useControlledState from '@rc-component/util/lib/hooks/useControlledState';
33
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
44
import raf from '@rc-component/util/lib/raf';
5-
import classNames from 'classnames';
5+
import { clsx } from 'clsx';
66
import * as React from 'react';
77
import type { TextAreaProps } from '.';
88
import calculateAutoSizeStyle from './calculateNodeHeight';
@@ -162,7 +162,7 @@ const ResizableTextArea = React.forwardRef<ResizableTextAreaRef, TextAreaProps>(
162162
{...restProps}
163163
ref={textareaRef}
164164
style={mergedStyle}
165-
className={classNames(prefixCls, className, {
165+
className={clsx(prefixCls, className, {
166166
[`${prefixCls}-disabled`]: disabled,
167167
})}
168168
disabled={disabled}

src/TextArea.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { type HolderRef } from '@rc-component/input/lib/BaseInput';
33
import useCount from '@rc-component/input/lib/hooks/useCount';
44
import { resolveOnChange } from '@rc-component/input/lib/utils/commonUtils';
55
import useControlledState from '@rc-component/util/lib/hooks/useControlledState';
6-
import clsx from 'classnames';
6+
import { clsx } from 'clsx';
77
import type { ReactNode } from 'react';
88
import React, { useEffect, useImperativeHandle, useRef } from 'react';
99
import ResizableTextArea from './ResizableTextArea';

0 commit comments

Comments
 (0)