Skip to content

Commit 0f558ac

Browse files
committed
Use remove-prop-types transform
1 parent 64d1c05 commit 0f558ac

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

modules/.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"env": {
88
"production": {
99
"plugins": [
10-
"dev-expression"
10+
"transform-react-remove-prop-types"
1111
]
1212
}
1313
}

modules/Media.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@ import React, { PropTypes } from 'react'
22
import json2mq from 'json2mq'
33

44
class Media extends React.Component {
5+
static propTypes = {
6+
query: PropTypes.oneOfType([
7+
PropTypes.string,
8+
PropTypes.object,
9+
PropTypes.arrayOf(PropTypes.object.isRequired)
10+
]).isRequired,
11+
render: PropTypes.func,
12+
children: PropTypes.oneOfType([
13+
PropTypes.node,
14+
PropTypes.func
15+
])
16+
}
17+
518
state = {
619
matches: true
720
}
@@ -40,19 +53,4 @@ class Media extends React.Component {
4053
}
4154
}
4255

43-
if (__DEV__) {
44-
Media.propTypes = {
45-
query: PropTypes.oneOfType([
46-
PropTypes.string,
47-
PropTypes.object,
48-
PropTypes.arrayOf(PropTypes.object.isRequired)
49-
]).isRequired,
50-
render: PropTypes.func,
51-
children: PropTypes.oneOfType([
52-
PropTypes.node,
53-
PropTypes.func
54-
])
55-
}
56-
}
57-
5856
export default Media

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "1.4.0",
44
"description": "A CSS media query component for React",
55
"repository": "ReactTraining/react-media",
6-
"author": "Michael Jackson",
76
"license": "MIT",
7+
"author": "Michael Jackson",
88
"scripts": {
99
"build": "node ./tools/build.js",
1010
"clean": "git clean -e '!node_modules' -fdX .",
@@ -20,7 +20,7 @@
2020
"babel-cli": "^6.11.4",
2121
"babel-eslint": "^7.0.0",
2222
"babel-loader": "^6.2.4",
23-
"babel-plugin-dev-expression": "^0.2.1",
23+
"babel-plugin-transform-react-remove-prop-types": "^0.3.2",
2424
"babel-preset-es2015": "^6.14.0",
2525
"babel-preset-react": "^6.11.1",
2626
"babel-preset-stage-1": "^6.5.0",

0 commit comments

Comments
 (0)