Skip to content

Commit ad11bc2

Browse files
committed
Upgrade react-prop-types
1 parent 7965346 commit ad11bc2

File tree

7 files changed

+19
-28
lines changed

7 files changed

+19
-28
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@
7474
"mocha": "^2.5.3",
7575
"node-libs-browser": "^1.0.0",
7676
"raw-loader": "^0.5.1",
77-
"react": "^15.2.1",
78-
"react-addons-test-utils": "^15.2.1",
77+
"react": "^15.3.0",
78+
"react-addons-test-utils": "^15.3.0",
7979
"react-bootstrap": "^0.29.5",
8080
"react-component-metadata": "^3.0.0",
81-
"react-dom": "^15.2.1",
81+
"react-dom": "^15.3.0",
8282
"react-hot-loader": "^1.3.0",
8383
"release-script": "^1.0.2",
8484
"rimraf": "^2.5.3",
@@ -94,7 +94,7 @@
9494
"dependencies": {
9595
"classnames": "^2.2.5",
9696
"dom-helpers": "^2.4.0",
97-
"react-prop-types": "^0.3.2",
97+
"react-prop-types": "^0.4.0",
9898
"warning": "^3.0.0"
9999
}
100100
}

src/AutoAffix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import getOffset from 'dom-helpers/query/offset';
22
import requestAnimationFrame from 'dom-helpers/util/requestAnimationFrame';
33
import React from 'react';
4-
import mountable from 'react-prop-types/lib/mountable';
4+
import componentOrElement from 'react-prop-types/lib/componentOrElement';
55

66
import Affix from './Affix';
77
import addEventListener from './utils/addEventListener';
@@ -155,7 +155,7 @@ AutoAffix.propTypes = {
155155
* of viewport, or a function that returns it
156156
*/
157157
container: React.PropTypes.oneOfType([
158-
mountable,
158+
componentOrElement,
159159
React.PropTypes.func
160160
]),
161161
/**

src/Modal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*eslint-disable react/prop-types */
22
import React, { cloneElement } from 'react';
33
import warning from 'warning';
4-
import mountable from 'react-prop-types/lib/mountable';
4+
import componentOrElement from 'react-prop-types/lib/componentOrElement';
55
import elementType from 'react-prop-types/lib/elementType';
66

77
import Portal from './Portal';
@@ -54,7 +54,7 @@ const Modal = React.createClass({
5454
* page content can be placed behind a virtual backdrop as well as a visual one.
5555
*/
5656
container: React.PropTypes.oneOfType([
57-
mountable,
57+
componentOrElement,
5858
React.PropTypes.func
5959
]),
6060

src/Overlay.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,13 @@ Overlay.propTypes = {
121121
*
122122
* @type func
123123
*/
124-
onHide(props, name, cname) {
125-
let pt = React.PropTypes.func;
124+
onHide(props, ...args) {
125+
let propType = React.PropTypes.func;
126+
if (props.rootClose) {
127+
propType = propType.isRequired;
128+
}
126129

127-
if (props.rootClose) pt = pt.isRequired
128-
return pt(props, name, cname)
130+
return propType(props, ...args)
129131
},
130132

131133
/**

src/Portal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import mountable from 'react-prop-types/lib/mountable';
3+
import componentOrElement from 'react-prop-types/lib/componentOrElement';
44
import ownerDocument from './utils/ownerDocument';
55
import getContainer from './utils/getContainer';
66

@@ -19,7 +19,7 @@ let Portal = React.createClass({
1919
* appended to it.
2020
*/
2121
container: React.PropTypes.oneOfType([
22-
mountable,
22+
componentOrElement,
2323
React.PropTypes.func
2424
])
2525
},

src/Position.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import classNames from 'classnames';
22
import React, { cloneElement } from 'react';
33
import ReactDOM from 'react-dom';
4-
import mountable from 'react-prop-types/lib/mountable';
4+
import componentOrElement from 'react-prop-types/lib/componentOrElement';
55

66
import calculatePosition from './utils/calculatePosition';
77
import getContainer from './utils/getContainer';
@@ -131,14 +131,14 @@ Position.propTypes = {
131131
* be positioned next to the `target` specified.
132132
*/
133133
target: React.PropTypes.oneOfType([
134-
mountable, React.PropTypes.func
134+
componentOrElement, React.PropTypes.func
135135
]),
136136

137137
/**
138138
* "offsetParent" of the component
139139
*/
140140
container: React.PropTypes.oneOfType([
141-
mountable, React.PropTypes.func
141+
componentOrElement, React.PropTypes.func
142142
]),
143143
/**
144144
* Minimum spacing in pixels between container border and component border

src/utils/requiredIf.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)