Skip to content

Commit 3d5566a

Browse files
Run react-codemod rename-unsafe-lifecycles src to remove warnings in developer mode
1 parent 27c07d4 commit 3d5566a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class MaskedInput extends React.Component {
6767
value: ''
6868
}
6969

70-
componentWillMount() {
70+
/* eslint-disable camelcase */
71+
UNSAFE_componentWillMount() {
7172
let options = {
7273
pattern: this.props.mask,
7374
value: this.props.value,
@@ -79,7 +80,8 @@ class MaskedInput extends React.Component {
7980
this.mask = new InputMask(options)
8081
}
8182

82-
componentWillReceiveProps(nextProps) {
83+
/* eslint-disable camelcase */
84+
UNSAFE_componentWillReceiveProps(nextProps) {
8385
if (this.props.mask !== nextProps.mask && this.props.value !== nextProps.mask) {
8486
// if we get a new value and a new mask at the same time
8587
// check if the mask.value is still the initial value
@@ -100,7 +102,8 @@ class MaskedInput extends React.Component {
100102
}
101103
}
102104

103-
componentWillUpdate(nextProps, nextState) {
105+
/* eslint-disable camelcase */
106+
UNSAFE_componentWillUpdate(nextProps, nextState) {
104107
if (nextProps.mask !== this.props.mask) {
105108
this._updatePattern(nextProps)
106109
}

0 commit comments

Comments
 (0)