Skip to content

Commit

Permalink
type: narrow onChange argument to React.Key[]
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyuan committed Sep 9, 2024
1 parent 44a5d48 commit 90933b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Collapse = React.forwardRef<HTMLDivElement, CollapseProps>((props, ref) =>

const [activeKey, setActiveKey] = useMergedState<React.Key | React.Key[], React.Key[]>([], {
value: rawActiveKey,
onChange: (v) => onChange?.(v),
onChange: (v) => onChange?.(v as React.Key[]),
defaultValue: defaultActiveKey,
postState: getActiveKeysArray,
});
Expand Down
2 changes: 1 addition & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface CollapseProps {
activeKey?: React.Key | React.Key[];
defaultActiveKey?: React.Key | React.Key[];
openMotion?: CSSMotionProps;
onChange?: (key: React.Key | React.Key[]) => void;
onChange?: (key: React.Key[]) => void;
accordion?: boolean;
className?: string;
style?: object;
Expand Down

0 comments on commit 90933b4

Please sign in to comment.