Skip to content

Commit

Permalink
[fixed] 'componentClass' property type is 'elementType' now
Browse files Browse the repository at this point in the history
And it is not 'isRequired' now if a default value
in getDefaultProps() for it is provided.
  • Loading branch information
AlexKVal committed Jun 24, 2015
1 parent 0e5980f commit 6ffa325
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/Button.js
Original file line number Diff line number Diff line change
@@ -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],
Expand All @@ -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
},
Expand Down
3 changes: 2 additions & 1 deletion src/Col.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion src/Grid.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion src/Jumbotron.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion src/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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([
Expand Down
3 changes: 2 additions & 1 deletion src/Row.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down

0 comments on commit 6ffa325

Please sign in to comment.