Skip to content

Commit 411604b

Browse files
Scimonsterbenjeffery
authored andcommitted
Codemod to use prop-types package
1 parent ea13070 commit 411604b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"url": "https://github.com/benjeffery/react-plotlyjs.git"
1111
},
1212
"dependencies": {
13-
"lodash.clonedeep": "^4.5.0"
13+
"lodash.clonedeep": "^4.5.0",
14+
"prop-types": "^15.5.10"
1415
},
1516
"devDependencies": {
1617
"babel-cli": "^6.22.2",

src/PlotlyComponent.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23
import cloneDeep from 'lodash.clonedeep';
34

45
let createPlotlyComponent = (plotlyInstance) => React.createClass({
56
displayName: 'Plotly',
67
propTypes: {
7-
data: React.PropTypes.array,
8-
layout: React.PropTypes.object,
9-
config: React.PropTypes.object,
10-
onClick: React.PropTypes.func,
11-
onBeforeHover: React.PropTypes.func,
12-
onHover: React.PropTypes.func,
13-
onUnHover: React.PropTypes.func,
14-
onSelected: React.PropTypes.func
8+
data: PropTypes.array,
9+
layout: PropTypes.object,
10+
config: PropTypes.object,
11+
onClick: PropTypes.func,
12+
onBeforeHover: PropTypes.func,
13+
onHover: PropTypes.func,
14+
onUnHover: PropTypes.func,
15+
onSelected: PropTypes.func
1516
},
1617

1718
attachListeners: function() {

0 commit comments

Comments
 (0)