File tree Expand file tree Collapse file tree 4 files changed +20
-18
lines changed Expand file tree Collapse file tree 4 files changed +20
-18
lines changed Original file line number Diff line number Diff line change 4
4
" stage-1" ,
5
5
" react"
6
6
],
7
- "plugins" : [
8
- " babel-plugin-dev-expression"
9
- ]
7
+ "env" : {
8
+ "production" : {
9
+ "plugins" : [
10
+ " dev-expression" ,
11
+ " transform-react-remove-prop-types"
12
+ ]
13
+ }
14
+ }
10
15
}
Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ const createBroadcast = (initialValue) => {
37
37
* <Subscriber> component for a reference implementation.
38
38
*/
39
39
class Broadcast extends React . Component {
40
+ static propTypes = {
41
+ channel : PropTypes . string . isRequired ,
42
+ children : PropTypes . node . isRequired ,
43
+ value : PropTypes . any
44
+ }
45
+
40
46
static contextTypes = {
41
47
broadcasts : PropTypes . object
42
48
}
@@ -78,12 +84,4 @@ class Broadcast extends React.Component {
78
84
}
79
85
}
80
86
81
- if ( __DEV__ ) {
82
- Broadcast . propTypes = {
83
- channel : PropTypes . string . isRequired ,
84
- children : PropTypes . node . isRequired ,
85
- value : PropTypes . any
86
- }
87
- }
88
-
89
87
export default Broadcast
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ import React, { PropTypes } from 'react'
6
6
* and passes it to its children function.
7
7
*/
8
8
class Subscriber extends React . Component {
9
+ static propTypes = {
10
+ channel : PropTypes . string . isRequired ,
11
+ children : PropTypes . func . isRequired
12
+ }
13
+
9
14
static contextTypes = {
10
15
broadcasts : PropTypes . object
11
16
}
@@ -50,11 +55,4 @@ class Subscriber extends React.Component {
50
55
}
51
56
}
52
57
53
- if ( __DEV__ ) {
54
- Subscriber . propTypes = {
55
- channel : PropTypes . string . isRequired ,
56
- children : PropTypes . func . isRequired
57
- }
58
- }
59
-
60
58
export default Subscriber
Original file line number Diff line number Diff line change 30
30
"babel-eslint" : " ^7.0.0" ,
31
31
"babel-loader" : " ^6.2.4" ,
32
32
"babel-plugin-dev-expression" : " ^0.2.1" ,
33
+ "babel-plugin-transform-react-remove-prop-types" : " ^0.2.11" ,
33
34
"babel-preset-es2015" : " ^6.9.0" ,
34
35
"babel-preset-es2015-loose" : " ^8.0.0" ,
35
36
"babel-preset-react" : " ^6.5.0" ,
You can’t perform that action at this time.
0 commit comments