Skip to content

Commit 080c0b5

Browse files
committed
create utils file
1 parent 61b60dc commit 080c0b5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Animate/Utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const isArray = (obj) => new Array(obj).isArray;

src/Animate/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
import React from 'react';
2+
import * as Utils from './Utils';
23

34
class Animate extends PureComponent {
45
render() {
5-
return null;
6+
const { Animation } = this.props;
7+
8+
if (Utils.isArray(Animation)) {
9+
return 'multiple animations';
10+
}
11+
12+
return (
13+
<Animation {...this.props}>
14+
{this.props.children}
15+
</Animation>
16+
);
617
}
718
}
819

0 commit comments

Comments
 (0)