Skip to content

Commit

Permalink
Merge pull request #575 from theopak/theopak/2019-11-08-rename-unsafe…
Browse files Browse the repository at this point in the history
…-lifecycle-methods

rename react lifecycle methods to prefix "UNSAFE_"
  • Loading branch information
nkbt committed Nov 12, 2019
2 parents 3305ecd + fe8aae3 commit 5d64304
Show file tree
Hide file tree
Showing 7 changed files with 534 additions and 436 deletions.
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"object-curly-newline": 0,
"function-paren-newline": 0,
"prefer-destructuring": 0,
"camelcase": ["error", {"allow": ["^UNSAFE_"]}],

"react/jsx-wrap-multilines": 0,
"react/jsx-one-expression-per-line": 0,
Expand All @@ -45,10 +46,13 @@
"getInitialState",
"getChildContext",
"componentWillMount",
"UNSAFE_componentWillMount",
"componentDidMount",
"componentWillReceiveProps",
"UNSAFE_componentWillReceiveProps",
"shouldComponentUpdate",
"componentWillUpdate",
"UNSAFE_componentWillUpdate",
"componentDidUpdate",
"componentWillUnmount",
"/^on.+$/",
Expand Down
22 changes: 11 additions & 11 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"dist/react-motion.js": {
"bundled": 76897,
"minified": 22572,
"gzipped": 6604
"bundled": 76939,
"minified": 22593,
"gzipped": 6614
},
"dist/react-motion.min.js": {
"bundled": 52319,
"minified": 15186,
"gzipped": 4433
"bundled": 52361,
"minified": 15207,
"gzipped": 4445
},
"dist/react-motion.esm.js": {
"bundled": 43136,
"minified": 14570,
"gzipped": 3570,
"bundled": 43178,
"minified": 14591,
"gzipped": 3582,
"treeshaked": {
"rollup": {
"code": 6374,
"code": 6381,
"import_statements": 196
},
"webpack": {
"code": 7581
"code": 7588
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"codemirror": "^5.5.0",
"cross-env": "^5.2.0",
"css-loader": "^0.28.11",
"eslint": "^5.0.1",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-config-prettier": "^2.9.0",
"eslint-loader": "^2.0.0",
Expand All @@ -36,10 +36,10 @@
"isparta-loader": "^2.0.0",
"jasmine-core": "^3.1.0",
"karma": "^2.0.4",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.2",
"karma-jasmine": "^1.1.2",
"karma-jasmine-diff-reporter": "^1.2.0",
"karma-chrome-launcher": "^2.2.0",
"karma-webpack": "^3.0.0",
"lint-staged": "^7.2.0",
"lodash.range": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/Motion.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export default class Motion extends React.Component<MotionProps, MotionState> {
this.startAnimationIfNecessary();
}

componentWillReceiveProps(props: MotionProps) {
UNSAFE_componentWillReceiveProps(props: MotionProps) {
if (this.unreadPropStyle != null) {
// previous props haven't had the chance to be set yet; set them here
this.clearUnreadPropStyle(this.unreadPropStyle);
Expand Down
2 changes: 1 addition & 1 deletion src/StaggeredMotion.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export default class StaggeredMotion extends React.Component<
this.startAnimationIfNecessary();
}

componentWillReceiveProps(props: StaggeredProps) {
UNSAFE_componentWillReceiveProps(props: StaggeredProps) {
if (this.unreadPropStyles != null) {
// previous props haven't had the chance to be set yet; set them here
this.clearUnreadPropStyle(this.unreadPropStyles);
Expand Down
2 changes: 1 addition & 1 deletion src/TransitionMotion.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ export default class TransitionMotion extends React.Component<
this.startAnimationIfNecessary();
}

componentWillReceiveProps(props: TransitionProps) {
UNSAFE_componentWillReceiveProps(props: TransitionProps) {
if (this.unreadPropStyles) {
// previous props haven't had the chance to be set yet; set them here
this.clearUnreadPropStyle(this.unreadPropStyles);
Expand Down
Loading

0 comments on commit 5d64304

Please sign in to comment.