From 67d31f5fb6448fe9f23781d503b10dd6ed283f61 Mon Sep 17 00:00:00 2001 From: sheaivey Date: Sat, 3 Jun 2017 16:16:33 -0700 Subject: [PATCH 1/3] adding prop-types peer dependancy. --- package.json | 6 ++++-- yarn.lock | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8fdee47..6a0e975 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/yarn.lock b/yarn.lock index 2c94c8f..d54c980 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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: From 6af9150133a6722199cc87fcab324ab965efb732 Mon Sep 17 00:00:00 2001 From: sheaivey Date: Sat, 3 Jun 2017 16:17:01 -0700 Subject: [PATCH 2/3] Switching to using prop-types. --- src/components/AxiosProvider.js | 7 ++++--- src/components/Request.js | 25 +++++++++++++------------ src/components/RequestWrapper.js | 1 - 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/components/AxiosProvider.js b/src/components/AxiosProvider.js index 567fc21..2a7dc64 100644 --- a/src/components/AxiosProvider.js +++ b/src/components/AxiosProvider.js @@ -1,4 +1,5 @@ import React from 'react' +import PropTypes from 'prop-types' class AxiosProvider extends React.Component { constructor(props) { @@ -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 diff --git a/src/components/Request.js b/src/components/Request.js index 387482c..6ba703c 100644 --- a/src/components/Request.js +++ b/src/components/Request.js @@ -1,4 +1,5 @@ import React from 'react' +import PropTypes from 'prop-types' import axios from 'axios' import { debounce } from '../utils' @@ -86,7 +87,7 @@ class Request extends React.Component { } Request.contextTypes = { - axios: React.PropTypes.func + axios: PropTypes.func } Request.defaultProps = { @@ -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 diff --git a/src/components/RequestWrapper.js b/src/components/RequestWrapper.js index df973bb..0308ae0 100644 --- a/src/components/RequestWrapper.js +++ b/src/components/RequestWrapper.js @@ -1,4 +1,3 @@ -/* eslint react/prop-types: 0 */ import React from 'react' import Request from './Request' From ae7aeb4139e9dd881bd0213d513cac9dcf021ed7 Mon Sep 17 00:00:00 2001 From: sheaivey Date: Sat, 3 Jun 2017 16:23:43 -0700 Subject: [PATCH 3/3] mistakenly removed this line. --- src/components/RequestWrapper.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/RequestWrapper.js b/src/components/RequestWrapper.js index 0308ae0..df973bb 100644 --- a/src/components/RequestWrapper.js +++ b/src/components/RequestWrapper.js @@ -1,3 +1,4 @@ +/* eslint react/prop-types: 0 */ import React from 'react' import Request from './Request'