This repository was archived by the owner on May 13, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React from 'react' ;
22import classNames from 'classnames' ;
33import Button from './Button' ;
4- import singlePropFrom from 'react-prop-types/lib/singlePropFrom' ;
54import SafeAnchor from './SafeAnchor' ;
65
76const CARET = < span > < span className = "caret" /> </ span > ;
@@ -23,17 +22,12 @@ export default class DropdownToggle extends React.Component {
2322 type = "button"
2423 aria-haspopup
2524 aria-expanded = { this . props . open } >
26- { this . props . title || this . props . children } { caret }
25+ { this . props . children || this . props . title } { caret }
2726 </ Component >
2827 ) ;
2928 }
3029}
3130
32- const titleAndChildrenValidation = singlePropFrom (
33- 'title' ,
34- 'children'
35- ) ;
36-
3731DropdownToggle . defaultProps = {
3832 open : false ,
3933 useAnchor : false ,
@@ -42,10 +36,9 @@ DropdownToggle.defaultProps = {
4236
4337DropdownToggle . propTypes = {
4438 bsRole : React . PropTypes . string ,
45- children : titleAndChildrenValidation ,
4639 noCaret : React . PropTypes . bool ,
4740 open : React . PropTypes . bool ,
48- title : titleAndChildrenValidation ,
41+ title : React . PropTypes . string ,
4942 useAnchor : React . PropTypes . bool
5043} ;
5144
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ describe('DropdownToggle', () => {
2727
2828 it ( 'renders title children' , ( ) => {
2929 const instance = ReactTestUtils . renderIntoDocument (
30- < DropdownToggle open = { false } >
30+ < DropdownToggle title = "toggle" open = { false } >
3131 < h3 > herpa derpa</ h3 >
3232 </ DropdownToggle >
3333 ) ;
You can’t perform that action at this time.
0 commit comments