Skip to content

Commit fef9c44

Browse files
author
刘欢
committed
chore: Replace classnames with clsx
1 parent 142c9a1 commit fef9c44

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"now-build": "npm run docs:build"
4545
},
4646
"dependencies": {
47-
"classnames": "^2.2.1",
47+
"clsx": "^2.2.1",
4848
"@rc-component/resize-observer": "^1.0.0",
4949
"@rc-component/util": "^1.3.0"
5050
},
@@ -53,7 +53,6 @@
5353
"@rc-component/np": "^1.0.3",
5454
"@testing-library/jest-dom": "^5.16.4",
5555
"@testing-library/react": "^12.0.0",
56-
"@types/classnames": "^2.2.9",
5756
"@types/enzyme": "^3.10.8",
5857
"@types/jest": "^26.0.23",
5958
"@types/node": "^24.8.1",

src/Item.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 ResizeObserver from '@rc-component/resize-observer';
44
import type { ComponentType } from './RawItem';
55

@@ -89,7 +89,7 @@ function InternalItem<ItemType>(
8989

9090
let itemNode = (
9191
<Component
92-
className={classNames(!invalidate && prefixCls, className)}
92+
className={clsx(!invalidate && prefixCls, className)}
9393
style={{
9494
...overflowStyle,
9595
...style,

src/Overflow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { useState, useMemo, useCallback } from 'react';
3-
import classNames from 'classnames';
3+
import clsx from 'clsx';
44
import ResizeObserver from '@rc-component/resize-observer';
55
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
66
import Item from './Item';
@@ -394,7 +394,7 @@ function Overflow<ItemType = any>(
394394

395395
const overflowNode = (
396396
<Component
397-
className={classNames(!invalidate && prefixCls, className)}
397+
className={clsx(!invalidate && prefixCls, className)}
398398
style={style}
399399
ref={ref}
400400
{...restProps}

src/RawItem.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 Item from './Item';
44
import { OverflowContext } from './context';
55

@@ -31,7 +31,7 @@ const InternalRawItem = (props: RawItemProps, ref: React.Ref<any>) => {
3131
<OverflowContext.Provider value={null}>
3232
<Item
3333
ref={ref}
34-
className={classNames(contextClassName, className)}
34+
className={clsx(contextClassName, className)}
3535
{...restContext}
3636
{...restProps}
3737
/>

0 commit comments

Comments
 (0)