Skip to content
Merged
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
13 changes: 7 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, cloneElement, Children } from 'react';
import PropTypes from 'prop-types'

class ChartistGraph extends Component {

Expand Down Expand Up @@ -64,12 +65,12 @@ class ChartistGraph extends Component {
}

ChartistGraph.propTypes = {
type: React.PropTypes.oneOf(['Line', 'Bar', 'Pie']).isRequired,
data: React.PropTypes.object.isRequired,
className: React.PropTypes.string,
options: React.PropTypes.object,
responsiveOptions: React.PropTypes.array,
style: React.PropTypes.object
type: PropTypes.oneOf(['Line', 'Bar', 'Pie']).isRequired,
data: PropTypes.object.isRequired,
className: PropTypes.string,
options: PropTypes.object,
responsiveOptions: PropTypes.array,
style: PropTypes.object
}

export default ChartistGraph;
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"homepage": "https://github.com/fraserxu/react-chartist",
"peerDependencies": {
"chartist": "^0.10.1",
"react": "^0.14.0 || ^15.0.0-0"
"react": "^0.14.9 || ^15.3.0"
},
"scripts": {
"build": "mkdir -p dist && babel index.js -o dist/index.js"
Expand All @@ -43,5 +43,8 @@
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-0": "^6.16.0"
},
"dependencies": {
"prop-types": "^15.5.8"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about user using React version < 15.5? Will they have both standalone prop-types and the build in React.PropTypes?

Copy link
Contributor Author

@robinsoncol robinsoncol Apr 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they will have both.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also bump the version of react under peerDependencies to ^0.14.9 || ^0.15.3, since those are the compatible version of the new standalone 'prop-types'. If you don't, and a user has an older version of react, they are going to get this warning: Warning: Failed propType: Calling PropTypes validators directly is not supported by the 'prop-types' package. Use 'PropTypes.checkPropTypes()' to call them..

}
}