diff --git a/package.json b/package.json index 8dc4d65..5848aa0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-rating", - "version": "2.0.2", + "version": "2.0.3", "description": "A stars rating component for react-native built with the Animated API", "main": "./src/rating.js", "scripts": { diff --git a/readme.md b/readme.md index ea91908..8ad2eba 100644 --- a/readme.md +++ b/readme.md @@ -47,7 +47,7 @@ Refer to the `propTypes` and `defaultProps` definition below: static propTypes = { max: PropTypes.number, initial: PropTypes.number, - onChange: PropTypes.func.isRequired, + onChange: PropTypes.func, config: PropTypes.shape({ easing: PropTypes.func.isRequired, duration: PropTypes.number.isRequired @@ -64,6 +64,7 @@ static propTypes = { static defaultProps = { max: 5, initial: 0, + onChange: () => {}, config: { easing: Easing.elastic(1), duration: 400 diff --git a/src/rating.js b/src/rating.js index 5e71d49..40ba7ea 100644 --- a/src/rating.js +++ b/src/rating.js @@ -51,7 +51,7 @@ export default class Rating extends PureComponent { static propTypes = { max: PropTypes.number, initial: PropTypes.number, - onChange: PropTypes.func.isRequired, + onChange: PropTypes.func, config: PropTypes.shape({ easing: PropTypes.func.isRequired, duration: PropTypes.number.isRequired @@ -68,6 +68,7 @@ export default class Rating extends PureComponent { static defaultProps = { max: 5, initial: 0, + onChange: () => {}, config: { easing: Easing.elastic(1), duration: 400