Skip to content

Commit

Permalink
Use prop-types package
Browse files Browse the repository at this point in the history
  • Loading branch information
btmills committed Aug 15, 2017
1 parent 5e54086 commit 85795ed
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
9 changes: 5 additions & 4 deletions examples/example.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import PropTypes from 'prop-types';
import React from 'react';

export default class Example extends React.Component {

static propTypes = {
additionalClasses: React.PropTypes.string,
children: React.PropTypes.element.isRequired,
label: React.PropTypes.string.isRequired,
mapStyle: React.PropTypes.object
additionalClasses: PropTypes.string,
children: PropTypes.element.isRequired,
label: PropTypes.string.isRequired,
mapStyle: PropTypes.object
};

render() {
Expand Down
5 changes: 3 additions & 2 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"start": "npm run dev"
},
"dependencies": {
"react": "^0.14.7",
"react-dom": "^0.14.7"
"prop-types": "^15.5.10",
"react": "^0.14.9",
"react-dom": "^0.14.9"
},
"devDependencies": {
"babel-core": "^6.4.5",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"lib/*.js"
],
"dependencies": {
"datamaps": "^0.4.2"
"datamaps": "^0.4.2",
"prop-types": "^15.5.10"
},
"devDependencies": {
"@btmills/eslint-config-btmills": "^1.0.0-beta.6",
Expand Down
25 changes: 13 additions & 12 deletions src/datamap.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react';
import Datamaps from 'datamaps';

Expand All @@ -14,18 +15,18 @@ const propChangeRequiresMapClear = (oldProps, newProps) => {
export default class Datamap extends React.Component {

static propTypes = {
arc: React.PropTypes.array,
arcOptions: React.PropTypes.object,
bubbleOptions: React.PropTypes.object,
bubbles: React.PropTypes.array,
data: React.PropTypes.object,
graticule: React.PropTypes.bool,
height: React.PropTypes.any,
labels: React.PropTypes.bool,
responsive: React.PropTypes.bool,
style: React.PropTypes.object,
updateChoroplethOptions: React.PropTypes.object,
width: React.PropTypes.any
arc: PropTypes.array,
arcOptions: PropTypes.object,
bubbleOptions: PropTypes.object,
bubbles: PropTypes.array,
data: PropTypes.object,
graticule: PropTypes.bool,
height: PropTypes.any,
labels: PropTypes.bool,
responsive: PropTypes.bool,
style: PropTypes.object,
updateChoroplethOptions: PropTypes.object,
width: PropTypes.any
};

constructor(props) {
Expand Down

0 comments on commit 85795ed

Please sign in to comment.