Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion examples/todo.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class TodoList extends React.Component {
return (
<div>
<button onClick={this.handleAdd}>Add Item</button>
<Animate transitionName="fade">
<Animate transitionName="fade" component={React.Fragment}>
{items}
</Animate>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/Animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ function getChildrenFromProps(props) {
function noop() {
}

function isReactFragment(component) {
return React.Fragment && component === React.Fragment;
}

class Animate extends React.Component {
static isAnimate = true; // eslint-disable-line

Expand Down Expand Up @@ -321,7 +325,7 @@ class Animate extends React.Component {
}
const Component = props.component;
if (Component) {
let passedProps = props;
let passedProps = isReactFragment(Component) ? {} : props;
if (typeof Component === 'string') {
passedProps = {
className: props.className,
Expand Down
2 changes: 1 addition & 1 deletion tests/multiple.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class TodoList extends React.Component {
});
return (
<div>
<Animate transitionName="example">
<Animate transitionName="example" component={React.Fragment}>
{items}
</Animate>
</div>
Expand Down