Skip to content

Commit

Permalink
fix: code style improve (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo837 committed Aug 18, 2023
1 parent fae5c99 commit 9e14261
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import ScrollBar from './ScrollBar';
import type { RenderFunc, SharedConfig, GetKey, ExtraRenderInfo } from './interface';
import useChildren from './hooks/useChildren';
import useHeights from './hooks/useHeights';
import useScrollTo, { type ScrollPos, type ScrollTarget } from './hooks/useScrollTo';
import useScrollTo from './hooks/useScrollTo';
import type { ScrollPos, ScrollTarget } from './hooks/useScrollTo';
import useDiffItem from './hooks/useDiffItem';
import useFrameWheel from './hooks/useFrameWheel';
import useMobileTouchMove from './hooks/useMobileTouchMove';
Expand Down Expand Up @@ -255,14 +256,14 @@ export function RawList<T>(props: ListProps<T>, ref: React.Ref<ListRef>) {
const verticalScrollBarRef = useRef<ScrollBarRef>();
const horizontalScrollBarRef = useRef<ScrollBarRef>();

const horizontalScrollBarSpinSize = React.useMemo(
() => getSpinSize(size.width, scrollWidth),
[size.width, scrollWidth],
);
const verticalScrollBarSpinSize = React.useMemo(
() => getSpinSize(size.height, scrollHeight),
[size.height, scrollHeight],
);
const horizontalScrollBarSpinSize = React.useMemo(() => getSpinSize(size.width, scrollWidth), [
size.width,
scrollWidth,
]);
const verticalScrollBarSpinSize = React.useMemo(() => getSpinSize(size.height, scrollHeight), [
size.height,
scrollHeight,
]);

// =============================== In Range ===============================
const maxScrollHeight = scrollHeight - height;
Expand Down

0 comments on commit 9e14261

Please sign in to comment.