-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathindex.js
More file actions
44 lines (37 loc) · 1.38 KB
/
index.js
File metadata and controls
44 lines (37 loc) · 1.38 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
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) {
if (!SUPPRESSED_WARNINGS.some((entry) => msg.includes(entry))) {
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);