Skip to content

Commit

Permalink
type(Collapse): fix export type error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 25, 2022
1 parent 03b2d38 commit 811d8dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/react-collapse/src/Collapse.tsx
Expand Up @@ -90,11 +90,13 @@ function InternalCollapse(props: CollapseProps, ref: React.ForwardedRef<HTMLDivE
);
}

const Collapse = React.forwardRef<HTMLDivElement, CollapseProps>(InternalCollapse);
type Collapse = typeof Collapse & {
type CollapseComponent = React.FC<React.PropsWithRef<CollapseProps>> & {
Panel: typeof Panel;
};

(Collapse as Collapse).Panel = Panel;
const Collapse: CollapseComponent = React.forwardRef<HTMLDivElement>(InternalCollapse) as unknown as CollapseComponent;

export default Collapse as Collapse;
Collapse.displayName = 'Collapse';
Collapse.Panel = Panel;

export default Collapse;

0 comments on commit 811d8dd

Please sign in to comment.