Skip to content

Commit

Permalink
Merge pull request #8 from sheaivey/prop-types
Browse files Browse the repository at this point in the history
Prop types
  • Loading branch information
sheaivey authored Jun 3, 2017
2 parents 017cb5a + ae7aeb4 commit 1d9f796
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@
"promise",
"node"
],
"dependencies": {},
"dependencies": {
},
"peerDependencies": {
"axios": "^0.15.0 || ^0.16.0",
"react": "^0.14.0 || ^15.0.0"
"react": "^0.14.0 || ^15.0.0",
"prop-types": "^15.5.0"
},
"devDependencies": {
"axios": "^0.16.2",
Expand Down
7 changes: 4 additions & 3 deletions src/components/AxiosProvider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import PropTypes from 'prop-types'

class AxiosProvider extends React.Component {
constructor(props) {
Expand All @@ -15,15 +16,15 @@ class AxiosProvider extends React.Component {
}

AxiosProvider.childContextTypes = {
axios: React.PropTypes.func
axios: PropTypes.func
}

AxiosProvider.defaultProps = {
}

AxiosProvider.propTypes = {
instance: React.PropTypes.func.isRequired,
children: React.PropTypes.any.isRequired
instance: PropTypes.func.isRequired,
children: PropTypes.any.isRequired
}

export default AxiosProvider
25 changes: 13 additions & 12 deletions src/components/Request.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import PropTypes from 'prop-types'
import axios from 'axios'
import { debounce } from '../utils'

Expand Down Expand Up @@ -86,7 +87,7 @@ class Request extends React.Component {
}

Request.contextTypes = {
axios: React.PropTypes.func
axios: PropTypes.func
}

Request.defaultProps = {
Expand All @@ -99,17 +100,17 @@ Request.defaultProps = {
}

Request.propTypes = {
instance: React.PropTypes.func,
url: React.PropTypes.string.isRequired,
method: React.PropTypes.string.isRequired,
data: React.PropTypes.object,
config: React.PropTypes.object,
isReady: React.PropTypes.bool,
debounce: React.PropTypes.number,
onSuccess: React.PropTypes.func,
onLoading: React.PropTypes.func,
onError: React.PropTypes.func,
children: React.PropTypes.func
instance: PropTypes.func,
url: PropTypes.string.isRequired,
method: PropTypes.string.isRequired,
data: PropTypes.object,
config: PropTypes.object,
isReady: PropTypes.bool,
debounce: PropTypes.number,
onSuccess: PropTypes.func,
onLoading: PropTypes.func,
onError: PropTypes.func,
children: PropTypes.func
}

export default Request
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3123,7 +3123,7 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"

prop-types@^15.5.7, prop-types@~15.5.7:
prop-types@^15.5.10, prop-types@^15.5.7, prop-types@~15.5.7:
version "15.5.10"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154"
dependencies:
Expand Down

0 comments on commit 1d9f796

Please sign in to comment.