Skip to content

Commit 03e348f

Browse files
committed
refactor: fix types to be matched with docs
1 parent e44e65e commit 03e348f

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/ReplaceTransition.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ class ReplaceTransition extends React.Component<Props> {
9292
] = React.Children.toArray(children);
9393

9494
return (
95-
// @ts-expect-error FIXME: This JSX tag's 'children' prop expects type 'ReactNode[] & ReactNode' which requires multiple children, but only a single child was provided.ts(2745)
9695
<TransitionGroup {...props}>
9796
{inProp
9897
? React.cloneElement(first, {

src/Transition.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
3-
import type { RefObject, ReactChildren, ReactNode } from 'react';
3+
import type { RefObject, ReactNode } from 'react';
44
import ReactDOM from 'react-dom';
55

66
import config from './config';
@@ -22,9 +22,7 @@ export type TransitionState =
2222

2323
export type Props = {
2424
nodeRef?: RefObject<HTMLElement>;
25-
children:
26-
| ReactChildren
27-
| ((state: TransitionState, childProps: any) => ReactNode);
25+
children: (state: TransitionState, childProps: any) => ReactNode;
2826
in: boolean;
2927
mountOnEnter: boolean;
3028
unmountOnExit: boolean;

src/TransitionGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const defaultProps = {
2020

2121
type Props = {
2222
component: any;
23-
children: ReactNode[];
23+
children: any;
2424
appear: boolean;
2525
enter: boolean;
2626
exit: boolean;

0 commit comments

Comments
 (0)