File tree Expand file tree Collapse file tree 8 files changed +15
-10
lines changed Expand file tree Collapse file tree 8 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ function reportException(
103
103
}
104
104
105
105
if ( __DEV__ ) {
106
- const LogBox = require ( '../LogBox/LogBox' ) ;
106
+ const LogBox = require ( '../LogBox/LogBox' ) . default ;
107
107
LogBox . addException ( {
108
108
...data ,
109
109
isComponentError : ! ! e . isComponentError ,
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ require('./setUpSegmentFetcher');
40
40
if ( __DEV__ ) {
41
41
require ( './checkNativeVersion' ) ;
42
42
require ( './setUpDeveloperTools' ) ;
43
- require ( '../LogBox/LogBox' ) . install ( ) ;
43
+ require ( '../LogBox/LogBox' ) . default . install ( ) ;
44
44
}
45
45
46
46
require ( '../ReactNative/AppRegistry' ) ;
Original file line number Diff line number Diff line change 10
10
11
11
'use strict' ;
12
12
13
- const LogBox = require ( '../../LogBox/LogBox' ) ;
13
+ import LogBox from '../../LogBox/LogBox' ;
14
+
14
15
const ExceptionsManager = require ( '../ExceptionsManager' ) ;
15
16
const NativeExceptionsManager = require ( '../NativeExceptionsManager' ) . default ;
16
17
const ReactFiberErrorDialog = require ( '../ReactFiberErrorDialog' ) . default ;
@@ -57,9 +58,12 @@ function runExceptionsManagerTests() {
57
58
let logBoxAddException ;
58
59
59
60
beforeEach ( ( ) => {
61
+ logBoxAddException = jest . fn ( ) ;
60
62
jest . resetModules ( ) ;
61
63
jest . mock ( '../../LogBox/LogBox' , ( ) => ( {
62
- addException : jest . fn ( ) ,
64
+ default : {
65
+ addException : logBoxAddException ,
66
+ } ,
63
67
} ) ) ;
64
68
jest . mock ( '../NativeExceptionsManager' , ( ) => {
65
69
return {
@@ -80,7 +84,6 @@ function runExceptionsManagerTests() {
80
84
) ;
81
85
jest . spyOn ( console , 'error' ) . mockReturnValue ( undefined ) ;
82
86
nativeReportException = NativeExceptionsManager . reportException ;
83
- logBoxAddException = LogBox . addException ;
84
87
} ) ;
85
88
86
89
afterEach ( ( ) => {
Original file line number Diff line number Diff line change @@ -258,4 +258,4 @@ if (__DEV__) {
258
258
} ;
259
259
}
260
260
261
- module . exports = ( LogBox : ILogBox ) ;
261
+ export default ( LogBox : ILogBox ) ;
Original file line number Diff line number Diff line change 12
12
'use strict' ;
13
13
14
14
const LogBoxData = require ( '../Data/LogBoxData' ) ;
15
- const LogBox = require ( '../LogBox' ) ;
15
+ const LogBox = require ( '../LogBox' ) . default ;
16
16
17
17
declare var console: any ;
18
18
Original file line number Diff line number Diff line change 12
12
13
13
import type { IgnorePattern } from '../LogBox/Data/LogBoxData' ;
14
14
15
- const LogBox = require ( '../LogBox/LogBox' ) ;
15
+ import LogBox from '../LogBox/LogBox' ;
16
+
16
17
const React = require ( 'react' ) ;
17
18
18
19
type Props = $ReadOnly < { || } > ;
Original file line number Diff line number Diff line change 11
11
12
12
'use strict' ;
13
13
14
- const LogBox = require ( '../../LogBox/LogBox' ) ;
14
+ import LogBox from '../../LogBox/LogBox' ;
15
+
15
16
const YellowBox = require ( '../YellowBoxDeprecated' ) ;
16
17
17
18
describe ( 'YellowBox' , ( ) => {
Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ module.exports = {
282
282
return require ( './Libraries/Linking/Linking' ) ;
283
283
} ,
284
284
get LogBox ( ) : LogBox {
285
- return require ( './Libraries/LogBox/LogBox' ) ;
285
+ return require ( './Libraries/LogBox/LogBox' ) . default ;
286
286
} ,
287
287
get NativeDialogManagerAndroid ( ) : NativeDialogManagerAndroid {
288
288
return require ( './Libraries/NativeModules/specs/NativeDialogManagerAndroid' )
You can’t perform that action at this time.
0 commit comments