Skip to content

Commit

Permalink
Adds a deprecation warning for drop-down-icon
Browse files Browse the repository at this point in the history
This component really should have had a deprecation warning from 0.14.0 when the old `./menu/menu` implementation was deprecated. This component is not used in any other components in src or docs. It also is not documented on the site. I think we should add this warning ASAP and plan for removal along with `./menu/menu` in our first `0.15.0` release candidate.
  • Loading branch information
newoga committed Jan 20, 2016
1 parent 952a289 commit 4a2cb00
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/drop-down-icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import FontIcon from './font-icon';
import Menu from './menu/menu';
import DefaultRawTheme from './styles/raw-themes/light-raw-theme';
import ThemeManager from './styles/theme-manager';
import warning from 'warning';

const DropDownIcon = React.createClass({

Expand Down Expand Up @@ -42,6 +43,9 @@ const DropDownIcon = React.createClass({
},

getInitialState() {
warning(false, 'DropDownIcon has been deprecated and will be removed in an upcoming verion.' +
' Please use IconMenu instead.');

return {
open: false,
muiTheme: this.context.muiTheme ? this.context.muiTheme : ThemeManager.getMuiTheme(DefaultRawTheme),
Expand All @@ -54,13 +58,6 @@ const DropDownIcon = React.createClass({
};
},

componentDidMount() {
// This component can be deprecated once ./menu/menu has been deprecated.
// if (process.env.NODE_ENV !== 'production') {
// console.warn('DropDownIcon has been deprecated. Use IconMenu instead.');
// }
},

//to update theme inside state whenever a new theme is passed down
//from the parent / owner using context
componentWillReceiveProps(nextProps, nextContext) {
Expand Down

0 comments on commit 4a2cb00

Please sign in to comment.