Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 1c2b62e

Browse files
committed
Using prop-types package for React 15.5 compatibility
1 parent 54444f0 commit 1c2b62e

11 files changed

+26
-16
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"invariant": "~2.2.1",
9494
"lodash.get": "~4.4.2",
9595
"lodash.topath": "~4.5.2",
96+
"prop-types": "^15.5.6",
9697
"shallow-compare": "1.2.1"
9798
},
9899
"peerDependencies": {

src/components/control-component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Component, createElement, cloneElement, PropTypes } from 'react';
1+
import React, { Component, createElement, cloneElement } from 'react';
2+
import PropTypes from 'prop-types';
23
import { connect } from 'react-redux';
34
import { compose } from 'redux';
45
import identity from '../utils/identity';

src/components/errors-component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Component, PropTypes } from 'react';
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
23
import { connect } from 'react-redux';
34
import _get from '../utils/get';
45
import map from '../utils/map';

src/components/field-component.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { Component, PropTypes } from 'react';
2-
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
33
import _get from '../utils/get';
44
import identity from '../utils/identity';
55
import omit from '../utils/omit';

src/components/fieldset-component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Component, PropTypes } from 'react';
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
23
import { connect } from 'react-redux';
34
import getModel from '../utils/get-model';
45
import omit from '../utils/omit';

src/components/form-component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Component, PropTypes } from 'react';
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
23
import { connect } from 'react-redux';
34
import shallowEqual from '../utils/shallow-equal';
45
import _get from '../utils/get';

src/components/local-form-component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { PropTypes } from 'react';
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
23
import Form from './form-component';
34
import combineForms from '../reducers/forms-reducer';
45
import { createStore } from 'redux';

src/utils/resolve-model.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Component, PureComponent, PropTypes } from 'react';
1+
import React, { Component, PureComponent } from 'react';
2+
import PropTypes from 'prop-types';
23
import shallowEqual from './shallow-equal';
34

45
const ReactComponent = PureComponent || Component;

test/custom-control-component-spec.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint react/no-multi-comp:0 react/jsx-no-bind:0 */
22
import { assert } from 'chai';
3-
import React, { Component, PropTypes } from 'react';
3+
import React, { Component } from 'react';
4+
import PropTypes from 'prop-types';
45
import TestUtils from 'react-addons-test-utils';
56
import { Provider } from 'react-redux';
67

@@ -248,7 +249,7 @@ describe('custom <Control /> components', () => {
248249
}
249250

250251
TextInput.propTypes = {
251-
onChangeText: React.PropTypes.func,
252+
onChangeText: PropTypes.func,
252253
};
253254

254255
const mapProps = {
@@ -314,9 +315,9 @@ describe('custom <Control /> components', () => {
314315
}
315316

316317
TextInput.propTypes = {
317-
onChangeText: React.PropTypes.func,
318-
focus: React.PropTypes.bool,
319-
touched: React.PropTypes.bool,
318+
onChangeText: PropTypes.func,
319+
focus: PropTypes.bool,
320+
touched: PropTypes.bool,
320321
};
321322

322323
const mapProps = {

test/field-component-spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint react/no-multi-comp:0 react/jsx-no-bind:0 */
2-
import React, { PropTypes } from 'react';
2+
import React from 'react';
3+
import PropTypes from 'prop-types';
34
import ReactDOM from 'react-dom';
45
import { assert } from 'chai';
56
import { createStore, applyMiddleware, combineReducers } from 'redux';
@@ -187,7 +188,7 @@ Object.keys(testContexts).forEach((testKey) => {
187188
}
188189

189190
ChildOnlyComp.propTypes = {
190-
children: React.PropTypes.node,
191+
children: PropTypes.node,
191192
};
192193

193194
const field = TestUtils.renderIntoDocument(

0 commit comments

Comments
 (0)