Skip to content

Commit

Permalink
fix(warnings): remove lifecycle warnings. (#4244)
Browse files Browse the repository at this point in the history
  • Loading branch information
patelnav authored and jquense committed Aug 19, 2019
1 parent f583814 commit 2eafd5a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Carousel extends React.Component {
this.waitForNext();
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) { // eslint-disable-line
const activeIndex = this.getActiveIndex();

if (
Expand Down
2 changes: 1 addition & 1 deletion src/CarouselItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CarouselItem extends React.Component {
this.isUnmounted = false;
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) { // eslint-disable-line
if (this.props.active !== nextProps.active) {
this.setState({ direction: null });
}
Expand Down
2 changes: 1 addition & 1 deletion src/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class Dropdown extends React.Component {
this.focusNextOnOpen();
}

componentWillUpdate(nextProps) {
UNSAFE_componentWillUpdate(nextProps) { // eslint-disable-line
if (!nextProps.open && this.props.open) {
this._focusInDropdown = contains(
ReactDOM.findDOMNode(this.menu),
Expand Down
2 changes: 1 addition & 1 deletion src/TabContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class TabContent extends React.Component {
};
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) { // eslint-disable-line
if (!nextProps.animation && this.state.activeChild) {
this.setState({ activeKey: null, activeChild: null });
}
Expand Down
6 changes: 3 additions & 3 deletions src/utils/deprecationWarning.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ function deprecationWarning(oldname, newname, link) {

deprecationWarning.wrapper = (Component, ...args) =>
class DeprecatedComponent extends Component {
componentWillMount(...methodArgs) {
UNSAFE_componentWillMount(...methodArgs) { // eslint-disable-line
deprecationWarning(...args);

if (super.componentWillMount) {
super.componentWillMount(...methodArgs);
if (super.UNSAFE_componentWillMount) {
super.UNSAFE_componentWillMount(...methodArgs);
}
}
};
Expand Down

0 comments on commit 2eafd5a

Please sign in to comment.