Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import AnimateChild from './AnimateChild';
const defaultKey = `rc_animate_${Date.now()}`;
import animUtil from './util';

const IS_FRAGMENT_SUPPORTED = React.version > '16';

function getChildrenFromProps(props) {
const children = props.children;
if (React.isValidElement(children)) {
Expand Down Expand Up @@ -328,6 +330,9 @@ export default class Animate extends React.Component {
}
return <Component {...passedProps}>{children}</Component>;
}
if (IS_FRAGMENT_SUPPORTED) {
return children;
}
return children[0] || null;
}
}