Skip to content

Commit

Permalink
Fix for bug introduced by new deprecation code.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKVal committed May 1, 2015
1 parent 274c9cb commit 92c57ef
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/CollapsableMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ const CollapsableMixin = assign({}, CollapsibleMixin, {
link
);
return this.getCollapsableDimensionValue();
},

componentDidMount() {
deprecationWarning('CollapsableMixin', 'CollapsibleMixin', link);
}
});

deprecationWarning('CollapsableMixin', 'CollapsibleMixin', link);

export default CollapsableMixin;
7 changes: 1 addition & 6 deletions src/CollapsableNav.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import deprecationWarning from './utils/deprecationWarning';
import CollapsibleNav from './CollapsibleNav';

let CollapsableNav = CollapsibleNav;

deprecationWarning(
'CollapsableNav',
'CollapsibleNav',
'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963'
);
CollapsableNav.__deprecated__ = true;

export default CollapsableNav;
11 changes: 11 additions & 0 deletions src/CollapsibleNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import BootstrapMixin from './BootstrapMixin';
import CollapsibleMixin from './CollapsibleMixin';
import classNames from 'classnames';
import domUtils from './utils/domUtils';
import deprecationWarning from './utils/deprecationWarning';

import ValidComponentChildren from './utils/ValidComponentChildren';
import createChainedFunction from './utils/createChainedFunction';
Expand Down Expand Up @@ -42,6 +43,16 @@ const CollapsibleNav = React.createClass({
return height;
},

componentDidMount() {
if (this.constructor.__deprecated__) {
deprecationWarning(
'CollapsableNav',
'CollapsibleNav',
'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963'
);
}
},

render() {
/*
* this.props.collapsable is set in NavBar when a eventKey is supplied.
Expand Down

0 comments on commit 92c57ef

Please sign in to comment.