Skip to content

Commit 656f40d

Browse files
committed
[changed] 'id' prop-type made uniform throughout the project
React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.number ])
1 parent 7202970 commit 656f40d

File tree

8 files changed

+36
-8
lines changed

8 files changed

+36
-8
lines changed

docs/src/Anchor.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import React from 'react';
22

33
const Anchor = React.createClass({
44
propTypes: {
5-
id: React.PropTypes.string
5+
id: React.PropTypes.oneOfType([
6+
React.PropTypes.string,
7+
React.PropTypes.number
8+
])
69
},
710
render() {
811
return (

src/InputBase.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ InputBase.propTypes = {
220220
bsStyle: React.PropTypes.oneOf(['success', 'warning', 'error']),
221221
hasFeedback: React.PropTypes.bool,
222222
feedbackIcon: React.PropTypes.node,
223-
id: React.PropTypes.string,
223+
id: React.PropTypes.oneOfType([
224+
React.PropTypes.string,
225+
React.PropTypes.number
226+
]),
224227
groupClassName: React.PropTypes.string,
225228
wrapperClassName: React.PropTypes.string,
226229
labelClassName: React.PropTypes.string,

src/ListGroup.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ class ListGroup extends React.Component {
5959

6060
ListGroup.propTypes = {
6161
className: React.PropTypes.string,
62-
id: React.PropTypes.string
62+
id: React.PropTypes.oneOfType([
63+
React.PropTypes.string,
64+
React.PropTypes.number
65+
])
6366
};
6467

6568
export default ListGroup;

src/Nav.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ const Nav = React.createClass({
2424
/**
2525
* HTML id for the wrapper `nav` element
2626
*/
27-
id: React.PropTypes.string,
27+
id: React.PropTypes.oneOfType([
28+
React.PropTypes.string,
29+
React.PropTypes.number
30+
]),
2831
/**
2932
* CSS classes for the inner `ul` element
3033
*/

src/Panel.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ const Panel = React.createClass({
1111
collapsible: React.PropTypes.bool,
1212
onSelect: React.PropTypes.func,
1313
header: React.PropTypes.node,
14-
id: React.PropTypes.string,
14+
id: React.PropTypes.oneOfType([
15+
React.PropTypes.string,
16+
React.PropTypes.number
17+
]),
1518
footer: React.PropTypes.node,
1619
defaultExpanded: React.PropTypes.bool,
1720
expanded: React.PropTypes.bool,

src/Popover.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ const Popover = React.createClass({
1313
* @type {string}
1414
* @required
1515
*/
16-
id: isRequiredForA11y(React.PropTypes.string),
16+
id: isRequiredForA11y(
17+
React.PropTypes.oneOfType([
18+
React.PropTypes.string,
19+
React.PropTypes.number
20+
])
21+
),
1722

1823
/**
1924
* Sets the direction the Popover is positioned towards.

src/Tabs.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ const Tabs = React.createClass({
3636
*/
3737
bsStyle: React.PropTypes.oneOf(['tabs', 'pills']),
3838
animation: React.PropTypes.bool,
39-
id: React.PropTypes.string,
39+
id: React.PropTypes.oneOfType([
40+
React.PropTypes.string,
41+
React.PropTypes.number
42+
]),
4043
onSelect: React.PropTypes.func,
4144
position: React.PropTypes.oneOf(['top', 'left', 'right']),
4245
/**

src/Tooltip.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ const Tooltip = React.createClass({
1212
* @type {string}
1313
* @required
1414
*/
15-
id: isRequiredForA11y(React.PropTypes.string),
15+
id: isRequiredForA11y(
16+
React.PropTypes.oneOfType([
17+
React.PropTypes.string,
18+
React.PropTypes.number
19+
])
20+
),
1621

1722
/**
1823
* Sets the direction the Tooltip is positioned towards.

0 commit comments

Comments
 (0)