Skip to content

Commit 8078754

Browse files
committed
perf: uninstall classnames, install clsx
1 parent dd83257 commit 8078754

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ es
3030
coverage
3131
yarn.lock
3232
package-lock.json
33+
pnpm-lock.yaml
3334

3435
# umi
3536
.umi
3637
.umi-production
3738
.umi-test
38-
.env.local
39+
.env.local
3940

4041
# dumi
4142
.dumi/tmp
4243
.dumi/tmp-production
4344

44-
bun.lockb
45+
bun.lockb

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,22 @@
4747
"now-build": "npm run build",
4848
"prepare": "husky install"
4949
},
50-
"peerDependencies": {
51-
"react": ">=16.9.0",
52-
"react-dom": ">=16.9.0"
53-
},
5450
"dependencies": {
5551
"@rc-component/motion": "^1.1.4",
5652
"@rc-component/util": "^1.2.1",
57-
"classnames": "2.x"
53+
"clsx": "^2.1.1"
5854
},
5955
"devDependencies": {
60-
"@typescript-eslint/eslint-plugin": "^5.59.7",
61-
"@typescript-eslint/parser": "^5.59.7",
6256
"@rc-component/father-plugin": "^2.0.4",
6357
"@rc-component/np": "^1.0.3",
6458
"@testing-library/jest-dom": "^6.0.0",
6559
"@testing-library/react": "^15.0.7",
66-
"@types/classnames": "^2.2.10",
60+
"@types/node": "^24.5.2",
6761
"@types/react": "^18.0.0",
6862
"@types/react-dom": "^18.0.0",
6963
"@types/testing-library__jest-dom": "^6.0.0",
64+
"@typescript-eslint/eslint-plugin": "^5.59.7",
65+
"@typescript-eslint/parser": "^5.59.7",
7066
"@umijs/fabric": "^2.0.0",
7167
"@vitest/coverage-v8": "^0.34.2",
7268
"cross-env": "^7.0.0",
@@ -84,6 +80,10 @@
8480
"typescript": "^5.4.5",
8581
"vitest": "^0.34.2"
8682
},
83+
"peerDependencies": {
84+
"react": ">=16.9.0",
85+
"react-dom": ">=16.9.0"
86+
},
8787
"lint-staged": {
8888
"**/*.{js,jsx,tsx,ts,md,json}": [
8989
"prettier --write",

src/Notice.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import classNames from 'classnames';
1+
import { clsx } from 'clsx';
22
import KeyCode from '@rc-component/util/lib/KeyCode';
33
import * as React from 'react';
44
import type { NoticeConfig } from './interface';
@@ -120,9 +120,7 @@ const Notify = React.forwardRef<HTMLDivElement, NoticeProps & { times?: number }
120120
<div
121121
{...divProps}
122122
ref={ref}
123-
className={classNames(noticePrefixCls, className, {
124-
[`${noticePrefixCls}-closable`]: closable,
125-
})}
123+
className={clsx(noticePrefixCls, className, { [`${noticePrefixCls}-closable`]: closable })}
126124
style={style}
127125
onMouseEnter={(e) => {
128126
setHovering(true);

src/NoticeList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { CSSProperties, FC } from 'react';
22
import React, { useContext, useEffect, useRef, useState } from 'react';
3-
import clsx from 'classnames';
3+
import { clsx } from 'clsx';
44
import type { CSSMotionProps } from '@rc-component/motion';
55
import { CSSMotionList } from '@rc-component/motion';
66
import type {

0 commit comments

Comments
 (0)