Skip to content

Commit

Permalink
[changed] 'id' prop-type made uniform throughout the project
Browse files Browse the repository at this point in the history
React.PropTypes.oneOfType([
  React.PropTypes.string,
  React.PropTypes.number
])
  • Loading branch information
AlexKVal committed Aug 28, 2015
1 parent 7202970 commit 656f40d
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 8 deletions.
5 changes: 4 additions & 1 deletion docs/src/Anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import React from 'react';

const Anchor = React.createClass({
propTypes: {
id: React.PropTypes.string
id: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
])
},
render() {
return (
Expand Down
5 changes: 4 additions & 1 deletion src/InputBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ InputBase.propTypes = {
bsStyle: React.PropTypes.oneOf(['success', 'warning', 'error']),
hasFeedback: React.PropTypes.bool,
feedbackIcon: React.PropTypes.node,
id: React.PropTypes.string,
id: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
]),
groupClassName: React.PropTypes.string,
wrapperClassName: React.PropTypes.string,
labelClassName: React.PropTypes.string,
Expand Down
5 changes: 4 additions & 1 deletion src/ListGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ class ListGroup extends React.Component {

ListGroup.propTypes = {
className: React.PropTypes.string,
id: React.PropTypes.string
id: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
])
};

export default ListGroup;
5 changes: 4 additions & 1 deletion src/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ const Nav = React.createClass({
/**
* HTML id for the wrapper `nav` element
*/
id: React.PropTypes.string,
id: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
]),
/**
* CSS classes for the inner `ul` element
*/
Expand Down
5 changes: 4 additions & 1 deletion src/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const Panel = React.createClass({
collapsible: React.PropTypes.bool,
onSelect: React.PropTypes.func,
header: React.PropTypes.node,
id: React.PropTypes.string,
id: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
]),
footer: React.PropTypes.node,
defaultExpanded: React.PropTypes.bool,
expanded: React.PropTypes.bool,
Expand Down
7 changes: 6 additions & 1 deletion src/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ const Popover = React.createClass({
* @type {string}
* @required
*/
id: isRequiredForA11y(React.PropTypes.string),
id: isRequiredForA11y(
React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
])
),

/**
* Sets the direction the Popover is positioned towards.
Expand Down
5 changes: 4 additions & 1 deletion src/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ const Tabs = React.createClass({
*/
bsStyle: React.PropTypes.oneOf(['tabs', 'pills']),
animation: React.PropTypes.bool,
id: React.PropTypes.string,
id: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
]),
onSelect: React.PropTypes.func,
position: React.PropTypes.oneOf(['top', 'left', 'right']),
/**
Expand Down
7 changes: 6 additions & 1 deletion src/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ const Tooltip = React.createClass({
* @type {string}
* @required
*/
id: isRequiredForA11y(React.PropTypes.string),
id: isRequiredForA11y(
React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
])
),

/**
* Sets the direction the Tooltip is positioned towards.
Expand Down

0 comments on commit 656f40d

Please sign in to comment.