Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
},
"dependencies": {
"@babel/runtime": "^7.11.1",
"@rc-component/util": "^1.3.0",
"@rc-component/util": "^1.11.1",
"clsx": "^2.1.1",
"@rc-component/motion": "^1.1.4"
},
"devDependencies": {
"@rc-component/father-plugin": "^2.0.1",
"@rc-component/father-plugin": "^2.2.0",
"@rc-component/np": "^1.0.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^14.2.1",
Expand Down
3 changes: 1 addition & 2 deletions src/MotionThumb.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import CSSMotion from '@rc-component/motion';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import { composeRef } from '@rc-component/util/lib/ref';
import { composeRef, useLayoutEffect } from '@rc-component/util';
import { clsx } from 'clsx';
import * as React from 'react';
Comment on lines 1 to 4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

建议调整导入顺序,将 react 核心库置于顶部。保持一致的导入顺序(React -> 外部库 -> 本地文件)可以提升代码质量和维护性。

Suggested change
import CSSMotion from '@rc-component/motion';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import { composeRef } from '@rc-component/util/lib/ref';
import { composeRef, useLayoutEffect } from '@rc-component/util';
import { clsx } from 'clsx';
import * as React from 'react';
import * as React from 'react';
import CSSMotion from '@rc-component/motion';
import { composeRef, useLayoutEffect } from '@rc-component/util';
import { clsx } from 'clsx';

import type { SegmentedValue } from '.';
Expand Down
4 changes: 1 addition & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import useControlledState from '@rc-component/util/lib/hooks/useControlledState';
import omit from '@rc-component/util/lib/omit';
import { composeRef } from '@rc-component/util/lib/ref';
import { composeRef, omit, useControlledState } from '@rc-component/util';
import { clsx } from 'clsx';
import * as React from 'react';
Comment on lines +1 to 3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

建议调整导入顺序,将 react 核心库置于顶部,随后是外部第三方库(如 @rc-component/utilclsx)。这符合 React 开发的通用最佳实践,有助于提高代码的可读性和一致性。

Suggested change
import { composeRef, omit, useControlledState } from '@rc-component/util';
import { clsx } from 'clsx';
import * as React from 'react';
import * as React from 'react';
import { composeRef, omit, useControlledState } from '@rc-component/util';
import { clsx } from 'clsx';


Expand Down
Loading