From 6ffa325871e1ba5f606cc513ec20def7e782bb86 Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Tue, 23 Jun 2015 19:23:56 +0300 Subject: [PATCH] [fixed] 'componentClass' property type is 'elementType' now And it is not 'isRequired' now if a default value in getDefaultProps() for it is provided. --- src/Button.js | 3 ++- src/Col.js | 3 ++- src/Grid.js | 3 ++- src/Jumbotron.js | 3 ++- src/Navbar.js | 3 ++- src/Row.js | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Button.js b/src/Button.js index 27f1fa31e4..60104068a1 100644 --- a/src/Button.js +++ b/src/Button.js @@ -1,6 +1,7 @@ import React from 'react'; import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; +import CustomPropTypes from './utils/CustomPropTypes'; const Button = React.createClass({ mixins: [BootstrapMixin], @@ -11,7 +12,7 @@ const Button = React.createClass({ block: React.PropTypes.bool, navItem: React.PropTypes.bool, navDropdown: React.PropTypes.bool, - componentClass: React.PropTypes.node, + componentClass: CustomPropTypes.elementType, href: React.PropTypes.string, target: React.PropTypes.string }, diff --git a/src/Col.js b/src/Col.js index 0898e10b2e..4241a7ff21 100644 --- a/src/Col.js +++ b/src/Col.js @@ -1,6 +1,7 @@ import React from 'react'; import classNames from 'classnames'; import styleMaps from './styleMaps'; +import CustomPropTypes from './utils/CustomPropTypes'; const Col = React.createClass({ propTypes: { @@ -20,7 +21,7 @@ const Col = React.createClass({ smPull: React.PropTypes.number, mdPull: React.PropTypes.number, lgPull: React.PropTypes.number, - componentClass: React.PropTypes.node.isRequired + componentClass: CustomPropTypes.elementType }, getDefaultProps() { diff --git a/src/Grid.js b/src/Grid.js index 17c4ed5ccf..352b3a1b54 100644 --- a/src/Grid.js +++ b/src/Grid.js @@ -1,10 +1,11 @@ import React from 'react'; import classNames from 'classnames'; +import CustomPropTypes from './utils/CustomPropTypes'; const Grid = React.createClass({ propTypes: { fluid: React.PropTypes.bool, - componentClass: React.PropTypes.node.isRequired + componentClass: CustomPropTypes.elementType }, getDefaultProps() { diff --git a/src/Jumbotron.js b/src/Jumbotron.js index 2aacb10dfe..00de36a701 100644 --- a/src/Jumbotron.js +++ b/src/Jumbotron.js @@ -1,9 +1,10 @@ import React from 'react'; import classNames from 'classnames'; +import CustomPropTypes from './utils/CustomPropTypes'; const Jumbotron = React.createClass({ propTypes: { - componentClass: React.PropTypes.any.isRequired + componentClass: CustomPropTypes.elementType }, getDefaultProps() { diff --git a/src/Navbar.js b/src/Navbar.js index 785c2518a2..2a5ec0ea7b 100644 --- a/src/Navbar.js +++ b/src/Navbar.js @@ -4,6 +4,7 @@ import classNames from 'classnames'; import ValidComponentChildren from './utils/ValidComponentChildren'; import createChainedFunction from './utils/createChainedFunction'; +import CustomPropTypes from './utils/CustomPropTypes'; const Navbar = React.createClass({ mixins: [BootstrapMixin], @@ -15,7 +16,7 @@ const Navbar = React.createClass({ inverse: React.PropTypes.bool, fluid: React.PropTypes.bool, role: React.PropTypes.string, - componentClass: React.PropTypes.node.isRequired, + componentClass: CustomPropTypes.elementType, brand: React.PropTypes.node, toggleButton: React.PropTypes.node, toggleNavKey: React.PropTypes.oneOfType([ diff --git a/src/Row.js b/src/Row.js index 35e3364a8b..1bda490933 100644 --- a/src/Row.js +++ b/src/Row.js @@ -1,9 +1,10 @@ import React from 'react'; import classNames from 'classnames'; +import CustomPropTypes from './utils/CustomPropTypes'; const Row = React.createClass({ propTypes: { - componentClass: React.PropTypes.node.isRequired + componentClass: CustomPropTypes.elementType }, getDefaultProps() {