Skip to content

Commit

Permalink
Merge pull request #18 from senguidanos/master
Browse files Browse the repository at this point in the history
React 15.5 compatibility
  • Loading branch information
abdennour committed Jun 8, 2017
2 parents afd1bce + 855af7f commit 7d9de7e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"jsdom-global": "^2.1.0",
"mocha": "^3.2.0",
"mocha-lcov-reporter": "^1.2.0",
"react": "^15.4.1",
"react-addons-test-utils": "^15.4.1",
"react-dom": "^15.4.1",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
"sinon": "^1.17.6"
},
"babel": {
Expand Down
15 changes: 8 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import React from 'react';
import PropTypes from 'prop-types';

const PropTypes = {
const propTypes = {
completed: ((props, propName) => {
if (typeof props[propName] !== 'number')
return Progress.throwError('Invalid Props: "completed" should ∈ ℝ ');
if( props[propName] < 0 || props[propName] > 100) {
return Progress.throwError('Invalid Props: "completed" should be between 0 and 100' );
}
}),
color: React.PropTypes.string,
animation: React.PropTypes.number,
height: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
color: PropTypes.string,
animation: PropTypes.number,
height: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
])
};

Expand Down Expand Up @@ -42,7 +43,7 @@ class Progress extends React.Component {
}
};

Progress.propTypes = PropTypes;
Progress.propTypes = propTypes;
Progress.throwError = function() {
return new Error(...arguments);
};
Expand Down

0 comments on commit 7d9de7e

Please sign in to comment.