Skip to content

Commit 6af9150

Browse files
committed
Switching to using prop-types.
1 parent 67d31f5 commit 6af9150

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

src/components/AxiosProvider.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import PropTypes from 'prop-types'
23

34
class AxiosProvider extends React.Component {
45
constructor(props) {
@@ -15,15 +16,15 @@ class AxiosProvider extends React.Component {
1516
}
1617

1718
AxiosProvider.childContextTypes = {
18-
axios: React.PropTypes.func
19+
axios: PropTypes.func
1920
}
2021

2122
AxiosProvider.defaultProps = {
2223
}
2324

2425
AxiosProvider.propTypes = {
25-
instance: React.PropTypes.func.isRequired,
26-
children: React.PropTypes.any.isRequired
26+
instance: PropTypes.func.isRequired,
27+
children: PropTypes.any.isRequired
2728
}
2829

2930
export default AxiosProvider

src/components/Request.js

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import PropTypes from 'prop-types'
23
import axios from 'axios'
34
import { debounce } from '../utils'
45

@@ -86,7 +87,7 @@ class Request extends React.Component {
8687
}
8788

8889
Request.contextTypes = {
89-
axios: React.PropTypes.func
90+
axios: PropTypes.func
9091
}
9192

9293
Request.defaultProps = {
@@ -99,17 +100,17 @@ Request.defaultProps = {
99100
}
100101

101102
Request.propTypes = {
102-
instance: React.PropTypes.func,
103-
url: React.PropTypes.string.isRequired,
104-
method: React.PropTypes.string.isRequired,
105-
data: React.PropTypes.object,
106-
config: React.PropTypes.object,
107-
isReady: React.PropTypes.bool,
108-
debounce: React.PropTypes.number,
109-
onSuccess: React.PropTypes.func,
110-
onLoading: React.PropTypes.func,
111-
onError: React.PropTypes.func,
112-
children: React.PropTypes.func
103+
instance: PropTypes.func,
104+
url: PropTypes.string.isRequired,
105+
method: PropTypes.string.isRequired,
106+
data: PropTypes.object,
107+
config: PropTypes.object,
108+
isReady: PropTypes.bool,
109+
debounce: PropTypes.number,
110+
onSuccess: PropTypes.func,
111+
onLoading: PropTypes.func,
112+
onError: PropTypes.func,
113+
children: PropTypes.func
113114
}
114115

115116
export default Request

src/components/RequestWrapper.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint react/prop-types: 0 */
21
import React from 'react'
32
import Request from './Request'
43

0 commit comments

Comments
 (0)