Skip to content

Commit

Permalink
fix: fix TS error with transition types (#5610)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletsang committed Feb 16, 2021
1 parent 53ce159 commit bb84d81
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export type TransitionComponent = React.ComponentType<
{
in?: boolean;
appear?: boolean;
children: React.ReactElement;
} & TransitionCallbacks
>;

Expand Down
28 changes: 28 additions & 0 deletions tests/simple-types-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,40 @@ const style: React.CSSProperties = {
color: 'red',
};

class ClassComponent extends React.Component {
render() {
return <div>abc</div>;
}
}

const FunctionComponent: React.FC = () => {
return <div>abc</div>;
};

// eslint-disable-next-line @typescript-eslint/no-empty-function
const noop = () => {};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const MegaComponent = () => (
<>
<Fade>
<div>abc</div>
</Fade>
<Fade>
<ClassComponent />
</Fade>
<Fade>
<FunctionComponent />
</Fade>
<Collapse>
<div>abc</div>
</Collapse>
<Collapse>
<ClassComponent />
</Collapse>
<Collapse>
<FunctionComponent />
</Collapse>
<Alert transition={Fade} />
<Alert transition={Collapse} />
<Alert
Expand Down

0 comments on commit bb84d81

Please sign in to comment.