Skip to content

Commit

Permalink
fix: ts
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyair committed Dec 11, 2023
1 parent 4f3aafe commit 4073184
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
"typescript": "^5.3.3"
},
"peerDependencies": {
"react": ">=16.0.0",
Expand Down
9 changes: 4 additions & 5 deletions src/MotionThumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ import CSSMotion from 'rc-motion';
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
import { composeRef } from 'rc-util/lib/ref';
import * as React from 'react';
import type { SegmentedValue } from '.';

type ThumbReact = {
left: number;
right: number;
width: number;
} | null;

export interface MotionThumbInterface {
export interface MotionThumbInterface<Value = React.Key> {
containerRef: React.RefObject<HTMLDivElement>;
value: SegmentedValue;
getValueIndex: (value: SegmentedValue) => number;
value: Value;
getValueIndex: (value: Value) => number;
prefixCls: string;
motionName: string;
onMotionStart: VoidFunction;
Expand Down Expand Up @@ -55,7 +54,7 @@ export default function MotionThumb(props: MotionThumbInterface) {
const [prevValue, setPrevValue] = React.useState(value);

// =========================== Effect ===========================
const findValueElement = (val: SegmentedValue) => {
const findValueElement = (val: any) => {
const index = getValueIndex(val);

const ele = containerRef.current?.querySelectorAll<HTMLDivElement>(
Expand Down

0 comments on commit 4073184

Please sign in to comment.