Skip to content

Commit dd1fb89

Browse files
motiz88thymikee
authored andcommitted
feat: collapse YellowBox/DevTools frames in Metro config (#780)
* Collapse YellowBox/DevTools frames in Metro config React Native master (note: commit not pushed to GitHub yet) is no longer stripping `YellowBox` and React DevTools stack frames from warnings with the `framesToPop` mechanism, which we will be deprecating and ultimately removing from the default error reporter too. The recommended approach going forward is to rely on Metro's `customizeFrame` for all postprocessing of stack traces. This commit updates the default Metro config to skip stack frames in `YellowBox` and React DevTools code, thus preserving the old behaviour. As for compatibility and versioning: It is harmless to run this change against older RN versions, but the next RN release should include this CLI change. (cc @cpojer) * Fix typo in regex
1 parent 5724d29 commit dd1fb89

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/cli/src/tools/loadMetroConfig.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const INTERNAL_CALLSITES_REGEX = new RegExp(
2929
[
3030
'/Libraries/Renderer/implementations/.+\\.js$',
3131
'/Libraries/BatchedBridge/MessageQueue\\.js$',
32+
'/Libraries/YellowBox/.+\\.js$',
33+
'/node_modules/react-devtools-core/.+\\.js$',
3234
].join('|'),
3335
);
3436

0 commit comments

Comments
 (0)