File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
packages/react-native/Libraries Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 1010
1111import typeof { enable } from 'promise/setimmediate/rejection-tracking' ;
1212
13- const LogBox = require ( './LogBox/LogBox' ) . default ;
13+ import LogBox from './LogBox/LogBox' ;
1414
1515let rejectionTrackingOptions : $NonMaybeType < Parameters < enable > [ 0 ] > = {
1616 allRejections : true ,
@@ -25,24 +25,24 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
2525 message = Error . prototype . toString . call ( rejection ) ;
2626 const error : Error = ( rejection : $FlowFixMe ) ;
2727
28- const warning =
29- `Possible Unhandled Promise Rejection (id: ${ id } ):\n` +
30- `${ message ?? '' } \n` +
31- ( stack == null ? '' : stack ) ;
32-
33- // Print pretty unhandled rejections while on DEV
28+ // Print correct unhandled rejections stack while on DEV
3429 if ( __DEV__ ) {
3530 LogBox . addLog ( {
3631 level : 'warn' ,
37- message : { content : warning , substitutions : [ ] } ,
32+ message : {
33+ content :
34+ `Possible Unhandled Promise Rejection (id: ${ id } ):\n` +
35+ `${ message ?? '' } \n` ,
36+ substitutions : [ ] ,
37+ } ,
3838 componentStack : [ ] ,
3939 stack : error . stack ,
4040 category : 'possible_unhandled_promise_rejection' ,
4141 } ) ;
4242
4343 return ;
4444 } else {
45- console . warn ( warning ) ;
45+ stack = error . stack ;
4646 }
4747 } else {
4848 try {
You can’t perform that action at this time.
0 commit comments