-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev.js
69 lines (63 loc) · 2.17 KB
/
dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { YellowBox } from 'react-native';
import React from 'react';
export const devSettings = () => {
console.disableYellowBox = true;
YellowBox.ignoreWarnings(['Warning: componentWillMount']);
YellowBox.ignoreWarnings(['Warning: componentWillReceiveProps']);
YellowBox.ignoreWarnings(['Warning: componentWillUpdate']);
YellowBox.ignoreWarnings(['Warning: isMounted']);
YellowBox.ignoreWarnings(['Remote debugger']);
YellowBox.ignoreWarnings(['Module RCTImageLoader requires main queue setup']);
YellowBox.ignoreWarnings([
'Module ReactNativeShareExtension requires main queue setup'
]);
YellowBox.ignoreWarnings(['source.uri should not be an empty string']);
YellowBox.ignoreWarnings([
'Cannot update during an existing state transition'
]);
YellowBox.ignoreWarnings(['Require cycle']);
const whyDidYouRender = require('@welldone-software/why-did-you-render');
whyDidYouRender(React);
};
// componentDidUpdate(prevProps) {
// // console.log('NEW COMPONENT_DID_UPDATE:');
// // console.log(
// // `DIFF ${JSON.stringify(
// // getObjectDiff(
// // _.get(this.props, 'authUser', {}),
// // _.get(prevProps, 'authUser', {})
// // ),
// // undefined,
// // 2
// // )}`
// // );
// // const now = Object.entries(this.props);
// // const added = now.filter(([key, val]) => {
// // if (prevProps[key] === undefined) return true;
// // if (prevProps[key] !== val) {
// // console.log(`
// // CHANGED
// // ${key}
// // DIFF ${JSON.stringify(
// // getObjectDiff(val, prevProps[key]),
// // undefined,
// // 2
// // )}
// // NEW ${JSON.stringify(val, undefined, 2)}
// // OLD ${JSON.stringify(prevProps[key], undefined, 2)}`);
// // }
// // return false;
// // });
// // added.forEach(([key, val]) =>
// // console.log(`
// // ADDED
// // ${key}
// // ${JSON.stringify(val, undefined, 2)}`)
// // );
// console.log();
// }
// console.log(`PostDetail - Render Count: ${RENDER_COUNT}`);
// console.log('this.props');
// console.log(this.props);
// console.log('this.state');
// console.log(this.state);