Repository navigation
Expand file tree
/
Copy pathindex.js
More file actions
48 lines (40 loc) · 1.45 KB
/
Copy pathindex.js
File metadata and controls
48 lines (40 loc) · 1.45 KB
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
import { AppRegistry, LogBox } from 'react-native';
import { AppBuilder } from 'shoutem-core';
import 'es6-symbol/implement';
import extensions from './extensions.js';
// Suppress legacy warnings and errors
LogBox.ignoreLogs([
'Support for defaultProps will be removed',
'Warning: componentWillMount has been renamed',
'Warning: componentWillReceiveProps has been renamed',
'Warning: componentWillUpdate has been renamed',
'Require cycle:',
]);
// Also suppress console.error for these warnings
const originalConsoleError = console.error;
const SUPPRESSED_WARNINGS = [
'Support for defaultProps will be removed',
'Warning: componentWillMount has been renamed',
'Warning: componentWillReceiveProps has been renamed',
'Warning: componentWillUpdate has been renamed',
];
console.error = function filterWarnings(msg, ...args) {
const isSuppressed =
typeof msg === 'string' &&
SUPPRESSED_WARNINGS.some(entry => msg.includes(entry));
if (!isSuppressed) {
originalConsoleError(msg, ...args);
}
};
// import React from 'react';
// const whyDidYouRender = require('@welldone-software/why-did-you-render');
// whyDidYouRender(React, {
// trackAllPureComponents: true,
// collapseGroups: false,
// trackHooks: true,
// logOnDifferentValues: false,
// logOwnerReasons: false,
// });
const App = new AppBuilder().setExtensions(extensions).build();
// noinspection JSCheckFunctionSignatures
AppRegistry.registerComponent('ShoutemApp', () => App);