Skip to content

Commit

Permalink
Support string numbers for propTypes
Browse files Browse the repository at this point in the history
PropTypes only took a number for `staggerDurationBy`, but it feels
weird to specify a number for a prop. Better to accept numbers or
strings, and do the conversion within (which is done by multiplying
the number).
  • Loading branch information
joshwcomeau committed Feb 2, 2016
1 parent d61371f commit 62b2f33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-flip-move",
"version": "0.1.3",
"version": "0.1.4",
"description": "Effortless animation between DOM changes (eg. list reordering) using the FLIP technique.",
"main": "lib/index.js",
"files": [
Expand Down
5 changes: 4 additions & 1 deletion src/FlipMove.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ class FlipMove extends Component {
direction: PropTypes.string,
fill: PropTypes.string,
onComplete: PropTypes.func,
staggerDurationBy: PropTypes.number
staggerDurationBy: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
])
};

static defaultProps = {
Expand Down

0 comments on commit 62b2f33

Please sign in to comment.