diff --git a/package.json b/package.json index eeb4782..5995e97 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ }, "dependencies": { "@rc-component/util": "^1.3.0", - "classnames": "^2.3.2" + "clsx": "^2.1.1" }, "devDependencies": { "@rc-component/father-plugin": "^2.1.3", @@ -55,8 +55,8 @@ "@testing-library/jest-dom": "^6.1.5", "@testing-library/react": "^14.1.2", "@testing-library/user-event": "^14.4.3", - "@types/classnames": "^2.3.1", "@types/jest": "^29.2.4", + "@types/node": "^24.5.2", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.9", "@umijs/fabric": "^4.0.1", diff --git a/src/index.tsx b/src/index.tsx index 0c2afb7..d70945d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,5 +1,5 @@ import useControlledState from '@rc-component/util/lib/hooks/useControlledState'; -import classNames from 'classnames'; +import { clsx } from 'clsx'; import * as React from 'react'; import { forwardRef, useImperativeHandle, useRef } from 'react'; @@ -57,7 +57,7 @@ export const Checkbox = forwardRef((props, ref) => { nativeElement: holderRef.current, })); - const classString = classNames(prefixCls, className, { + const classString = clsx(prefixCls, className, { [`${prefixCls}-checked`]: rawValue, [`${prefixCls}-disabled`]: disabled, });