From edc080410aff2e990f1a4b5da54ddb27a09f2117 Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Sun, 28 Sep 2025 03:22:07 +0800 Subject: [PATCH] perf: uninstall classnames, install clsx --- .gitignore | 1 + package.json | 4 ++-- src/OptionList/Checkbox.tsx | 4 ++-- src/OptionList/Column.tsx | 13 +++++-------- src/OptionList/List.tsx | 4 ++-- src/Panel.tsx | 9 +++------ 6 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index e1eb4fbd..2565182b 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ lib es yarn.lock package-lock.json +pnpm-lock.yaml coverage # umi .umi diff --git a/package.json b/package.json index 134ab662..04140cba 100644 --- a/package.json +++ b/package.json @@ -46,16 +46,16 @@ "@rc-component/select": "~1.1.0", "@rc-component/tree": "~1.0.0", "@rc-component/util": "^1.3.0", - "classnames": "^2.3.1" + "clsx": "^2.1.1" }, "devDependencies": { "@rc-component/father-plugin": "^2.0.2", "@rc-component/np": "^1.0.3", "@rc-component/trigger": "^3.0.0", "@testing-library/react": "^12.1.5", - "@types/classnames": "^2.2.6", "@types/enzyme": "^3.1.15", "@types/jest": "^29.4.0", + "@types/node": "^24.5.2", "@types/react": "^19.0.0", "@types/react-dom": "^19.0.0", "@types/warning": "^3.0.0", diff --git a/src/OptionList/Checkbox.tsx b/src/OptionList/Checkbox.tsx index f06cfb23..1c1715a8 100644 --- a/src/OptionList/Checkbox.tsx +++ b/src/OptionList/Checkbox.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import classNames from 'classnames'; +import { clsx } from 'clsx'; import CascaderContext from '../context'; export interface CheckboxProps { @@ -25,7 +25,7 @@ export default function Checkbox({ return ( { - const ariaProps = pickAttrs(option, { - aria: true, - data: true - }); + const ariaProps = pickAttrs(option, { aria: true, data: true }); // >>>>> Open const triggerOpenPath = () => { if (isOptionDisabled(disabled)) { @@ -176,7 +173,7 @@ export default function Column(( return (