Skip to content

Commit 6ffa325

Browse files
committed
[fixed] 'componentClass' property type is 'elementType' now
And it is not 'isRequired' now if a default value in getDefaultProps() for it is provided.
1 parent 0e5980f commit 6ffa325

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

src/Button.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import classNames from 'classnames';
33
import BootstrapMixin from './BootstrapMixin';
4+
import CustomPropTypes from './utils/CustomPropTypes';
45

56
const Button = React.createClass({
67
mixins: [BootstrapMixin],
@@ -11,7 +12,7 @@ const Button = React.createClass({
1112
block: React.PropTypes.bool,
1213
navItem: React.PropTypes.bool,
1314
navDropdown: React.PropTypes.bool,
14-
componentClass: React.PropTypes.node,
15+
componentClass: CustomPropTypes.elementType,
1516
href: React.PropTypes.string,
1617
target: React.PropTypes.string
1718
},

src/Col.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import classNames from 'classnames';
33
import styleMaps from './styleMaps';
4+
import CustomPropTypes from './utils/CustomPropTypes';
45

56
const Col = React.createClass({
67
propTypes: {
@@ -20,7 +21,7 @@ const Col = React.createClass({
2021
smPull: React.PropTypes.number,
2122
mdPull: React.PropTypes.number,
2223
lgPull: React.PropTypes.number,
23-
componentClass: React.PropTypes.node.isRequired
24+
componentClass: CustomPropTypes.elementType
2425
},
2526

2627
getDefaultProps() {

src/Grid.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from 'react';
22
import classNames from 'classnames';
3+
import CustomPropTypes from './utils/CustomPropTypes';
34

45
const Grid = React.createClass({
56
propTypes: {
67
fluid: React.PropTypes.bool,
7-
componentClass: React.PropTypes.node.isRequired
8+
componentClass: CustomPropTypes.elementType
89
},
910

1011
getDefaultProps() {

src/Jumbotron.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from 'react';
22
import classNames from 'classnames';
3+
import CustomPropTypes from './utils/CustomPropTypes';
34

45
const Jumbotron = React.createClass({
56
propTypes: {
6-
componentClass: React.PropTypes.any.isRequired
7+
componentClass: CustomPropTypes.elementType
78
},
89

910
getDefaultProps() {

src/Navbar.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import classNames from 'classnames';
44

55
import ValidComponentChildren from './utils/ValidComponentChildren';
66
import createChainedFunction from './utils/createChainedFunction';
7+
import CustomPropTypes from './utils/CustomPropTypes';
78

89
const Navbar = React.createClass({
910
mixins: [BootstrapMixin],
@@ -15,7 +16,7 @@ const Navbar = React.createClass({
1516
inverse: React.PropTypes.bool,
1617
fluid: React.PropTypes.bool,
1718
role: React.PropTypes.string,
18-
componentClass: React.PropTypes.node.isRequired,
19+
componentClass: CustomPropTypes.elementType,
1920
brand: React.PropTypes.node,
2021
toggleButton: React.PropTypes.node,
2122
toggleNavKey: React.PropTypes.oneOfType([

src/Row.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from 'react';
22
import classNames from 'classnames';
3+
import CustomPropTypes from './utils/CustomPropTypes';
34

45
const Row = React.createClass({
56
propTypes: {
6-
componentClass: React.PropTypes.node.isRequired
7+
componentClass: CustomPropTypes.elementType
78
},
89

910
getDefaultProps() {

0 commit comments

Comments
 (0)