File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
packages/react-native/Libraries/LogBox/__tests__ Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ function findLogBoxInspectorUI(node: ReadOnlyElement): InspectorUI {
117117// anonymous
118118// MockConsoleErrorForTesting <-- mockConsoleIndex
119119// ManualConsoleError
120- // reactStackBottomFrame <-- react bottom frame
120+ // react_stack_bottom_frame <-- react bottom frame
121121// <root>
122122//
123123// Becomes:
@@ -129,9 +129,19 @@ function getStackFrames(node: ReadOnlyElement): ?Array<string> {
129129 const mockConsoleIndex = text . includes ( 'MockConsoleErrorForTesting' )
130130 ? text . indexOf ( 'MockConsoleErrorForTesting' ) + 1
131131 : 0 ;
132- const bottomFrameIndex = text . includes ( 'reactStackBottomFrame' )
133- ? text . indexOf ( 'reactStackBottomFrame' )
134- : text . length ;
132+ let bottomFrameIndex = text . indexOf ( 'react_stack_bottom_frame' ) ;
133+ if ( bottomFrameIndex === - 1 ) {
134+ // react@19.1.0 with @babel/plugin-transform-function-name
135+ bottomFrameIndex = text . indexOf ( 'reactStackBottomFrame' ) ;
136+ }
137+ if ( bottomFrameIndex === - 1 ) {
138+ // react@19.1.0 without @babel/plugin-transform-function-name
139+ bottomFrameIndex = text . indexOf ( 'react-stack-bottom-frame' ) ;
140+ }
141+ if ( bottomFrameIndex === - 1 ) {
142+ bottomFrameIndex = text . length ;
143+ }
144+
135145 return text . slice ( mockConsoleIndex , bottomFrameIndex ) ;
136146}
137147
You can’t perform that action at this time.
0 commit comments