File tree 2 files changed +3
-10
lines changed
2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import classNames from 'classnames' ;
3
3
import Button from './Button' ;
4
- import singlePropFrom from 'react-prop-types/lib/singlePropFrom' ;
5
4
import SafeAnchor from './SafeAnchor' ;
6
5
7
6
const CARET = < span > < span className = "caret" /> </ span > ;
@@ -23,17 +22,12 @@ export default class DropdownToggle extends React.Component {
23
22
type = "button"
24
23
aria-haspopup
25
24
aria-expanded = { this . props . open } >
26
- { this . props . title || this . props . children } { caret }
25
+ { this . props . children || this . props . title } { caret }
27
26
</ Component >
28
27
) ;
29
28
}
30
29
}
31
30
32
- const titleAndChildrenValidation = singlePropFrom (
33
- 'title' ,
34
- 'children'
35
- ) ;
36
-
37
31
DropdownToggle . defaultProps = {
38
32
open : false ,
39
33
useAnchor : false ,
@@ -42,10 +36,9 @@ DropdownToggle.defaultProps = {
42
36
43
37
DropdownToggle . propTypes = {
44
38
bsRole : React . PropTypes . string ,
45
- children : titleAndChildrenValidation ,
46
39
noCaret : React . PropTypes . bool ,
47
40
open : React . PropTypes . bool ,
48
- title : titleAndChildrenValidation ,
41
+ title : React . PropTypes . string ,
49
42
useAnchor : React . PropTypes . bool
50
43
} ;
51
44
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ describe('DropdownToggle', () => {
27
27
28
28
it ( 'renders title children' , ( ) => {
29
29
const instance = ReactTestUtils . renderIntoDocument (
30
- < DropdownToggle open = { false } >
30
+ < DropdownToggle title = "toggle" open = { false } >
31
31
< h3 > herpa derpa</ h3 >
32
32
</ DropdownToggle >
33
33
) ;
You can’t perform that action at this time.
0 commit comments